From 9d9e5cd11ac69d0d48292fdffa718e5c1ad0bbab Mon Sep 17 00:00:00 2001 From: Kiraub Date: Wed, 23 Jun 2021 19:10:00 +0200 Subject: [PATCH] inline nilfunc to nil comparison --- decode_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decode_test.go b/decode_test.go index f8e7a9f..a0d4eda 100644 --- a/decode_test.go +++ b/decode_test.go @@ -173,7 +173,7 @@ func Test_Decoder(t *testing.T) { assertEq(t, "struct.D.AA", 2, v.D.AA) assertEq(t, "struct.D.BB", "world", v.D.BB) assertEq(t, "struct.D.CC", true, v.D.CC) - assertEq(t, "struct.E", nil, v.E) + assertEq(t, "struct.E", true, v.E == nil) t.Run("struct.field null", func(t *testing.T) { var v struct { A string @@ -195,7 +195,7 @@ func Test_Decoder(t *testing.T) { assertNeq(t, "array", v.E, nil) assertEq(t, "array", len(v.E), 2) assertEq(t, "interface{}", v.F, nil) - assertEq(t, "func", v.G, nil) + assertEq(t, "nilfunc", true, v.G == nil) }) }) t.Run("interface", func(t *testing.T) { @@ -247,7 +247,7 @@ func Test_Decoder(t *testing.T) { t.Run("func", func(t *testing.T) { var v func() assertErr(t, json.Unmarshal([]byte(`null`), &v)) - assertEq(t, "func", nil, v) + assertEq(t, "nilfunc", true, v == nil) }) }