We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following code:
type J1 struct { Field1 string `json:"field_1"` Field2 string `json:"field_2"` } type J2 struct { *J1 Field3 string `json:"field_3"` Field4 string `json:"field_4"` } func Show() { v := J2{ Field3: "3", Field4: "3", } b, _ := easyjson.Marshal(v) println(string(b)) }
Expected behaviour: Print {"field_3":"3","field_4":"3"} on Show call as package json works
{"field_3":"3","field_4":"3"}
Show
json
Actual behaviour: panic: runtime error: invalid memory address or nil pointer dereference
Panic raises in the following generated code:
func easyjsonBd361432EncodeEasyjsonBug(out *jwriter.Writer, in J2) { out.RawByte('{') first := true _ = first { const prefix string = ",\"field_3\":" out.RawString(prefix[1:]) out.String(string(in.Field3)) } { const prefix string = ",\"field_4\":" out.RawString(prefix) out.String(string(in.Field4)) } { const prefix string = ",\"field_1\":" out.RawString(prefix) out.String(string(in.Field1)) } { const prefix string = ",\"field_2\":" out.RawString(prefix) out.String(string(in.Field2)) } out.RawByte('}') }
The text was updated successfully, but these errors were encountered:
I see the same error. Is there any solution or workaround for the issue?
Sorry, something went wrong.
No branches or pull requests
Consider the following code:
Expected behaviour:
Print
{"field_3":"3","field_4":"3"}
onShow
call as packagejson
worksActual behaviour:
panic: runtime error: invalid memory address or nil pointer dereference
Panic raises in the following generated code:
The text was updated successfully, but these errors were encountered: