You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type I interface {
Foo()
}
type A struct {
I
Val string
}
func TestStructWithEmbeddedInterface(t *testing.T) {
var s A
s.Val = "456"
j1, _ := json.Marshal(s) // This uses encoding/json.
fmt.Println("expected", string(j1))
j2, _ := goccyjson.Marshal(s) // This uses this library.
fmt.Println("actual", string(j2))
}
The code above will generate a json string that is not valid.
Expected result (using encoding/json): {"I":null,"Val":"456"}
Actual result: {null,"Val":"456"}
This can be reproduced with: github.com/goccy/go-json v0.10.0
The text was updated successfully, but these errors were encountered:
orisano
added a commit
to orisano/go-json
that referenced
this issue
Feb 24, 2023
Example:
The code above will generate a json string that is not valid.
Expected result (using
encoding/json
):{"I":null,"Val":"456"}
Actual result:
{null,"Val":"456"}
This can be reproduced with:
github.com/goccy/go-json v0.10.0
The text was updated successfully, but these errors were encountered: