From 4cc76529e84ba1809817d7d0eab98b6931c42e25 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Thu, 13 Sep 2018 21:51:59 +0300 Subject: [PATCH] remove redundant dereferencing expressions Found using https://go-critic.github.io/overview#underef-ref --- misc_tests/jsoniter_interface_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc_tests/jsoniter_interface_test.go b/misc_tests/jsoniter_interface_test.go index 38af1e5..6ea75b5 100644 --- a/misc_tests/jsoniter_interface_test.go +++ b/misc_tests/jsoniter_interface_test.go @@ -114,7 +114,7 @@ func Test_overwrite_interface_value_with_nil(t *testing.T) { err := json.Unmarshal([]byte(`{"payload": {"val": 42}}`), &wrapper) should.NoError(err) - should.Equal(42, (*(wrapper.Payload.(*Payload))).Value) + should.Equal(42, wrapper.Payload.(*Payload).Value) err = json.Unmarshal([]byte(`{"payload": null}`), &wrapper) should.NoError(err) @@ -128,7 +128,7 @@ func Test_overwrite_interface_value_with_nil(t *testing.T) { err = jsoniter.Unmarshal([]byte(`{"payload": {"val": 42}}`), &wrapper) should.Equal(nil, err) - should.Equal(42, (*(wrapper.Payload.(*Payload))).Value) + should.Equal(42, wrapper.Payload.(*Payload).Value) err = jsoniter.Unmarshal([]byte(`{"payload": null}`), &wrapper) should.Equal(nil, err)