Explorar el Código

Merge pull request #306 from Quasilyte/quasilyte/underef

remove redundant dereferencing expressions
Tao Wen hace 7 años
padre
commit
b9be8dd373
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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)