Skip to content

Commit 4cc7652

Browse files
committed
remove redundant dereferencing expressions
Found using https://go-critic.github.io/overview#underef-ref
1 parent 1624edc commit 4cc7652

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

misc_tests/jsoniter_interface_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func Test_overwrite_interface_value_with_nil(t *testing.T) {
114114

115115
err := json.Unmarshal([]byte(`{"payload": {"val": 42}}`), &wrapper)
116116
should.NoError(err)
117-
should.Equal(42, (*(wrapper.Payload.(*Payload))).Value)
117+
should.Equal(42, wrapper.Payload.(*Payload).Value)
118118

119119
err = json.Unmarshal([]byte(`{"payload": null}`), &wrapper)
120120
should.NoError(err)
@@ -128,7 +128,7 @@ func Test_overwrite_interface_value_with_nil(t *testing.T) {
128128

129129
err = jsoniter.Unmarshal([]byte(`{"payload": {"val": 42}}`), &wrapper)
130130
should.Equal(nil, err)
131-
should.Equal(42, (*(wrapper.Payload.(*Payload))).Value)
131+
should.Equal(42, wrapper.Payload.(*Payload).Value)
132132

133133
err = jsoniter.Unmarshal([]byte(`{"payload": null}`), &wrapper)
134134
should.Equal(nil, err)

0 commit comments

Comments
 (0)