Quellcode durchsuchen

Merge pull request #306 from Quasilyte/quasilyte/underef

remove redundant dereferencing expressions
Tao Wen vor 7 Jahren
Ursprung
Commit
b9be8dd373
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      misc_tests/jsoniter_interface_test.go

+ 2 - 2
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)