Open quintans opened 2 years ago
I noticed that when we enable support for private fields and if we add a json tag, the field is no longer marshalled/unmarshalled.
bellow is an example
type Foo struct { name string `json:"name"` } extra.SupportPrivateFields() wantedOutput := `{"name":"Paulo"}` foo := Foo{name: "Paulo"} b, err := jsoniter.Marshal(foo) output := string(b) if err != nil { fmt.Println("failed to marshal:", err) } else if output != wantedOutput { fmt.Printf("wanted '%s', got '%s'\n", wantedOutput, output) } else { fmt.Println("wanted output matches") }
this is easily fixed by deleting the following lines https://github.com/json-iterator/go/blob/master/extra/privat_fields.go#L48-L52
I noticed that when we enable support for private fields and if we add a json tag, the field is no longer marshalled/unmarshalled.
bellow is an example
this is easily fixed by deleting the following lines https://github.com/json-iterator/go/blob/master/extra/privat_fields.go#L48-L52