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
If there's a map[string]struct{} field in a struct, the generated code will not compile
map[string]struct{}
Eg:
type Example struct { M map[string]struct{} }
produces
// EncodeMsg implements msgp.Encodable func (z *Example) EncodeMsg(en *msgp.Writer) (err error) { // map header, size 1 // write "M" err = en.Append(0x81, 0xa1, 0x4d) if err != nil { return } err = en.WriteMapHeader(uint32(len(z.M))) if err != nil { err = msgp.WrapError(err, "M") return } for za0001, za0002 := range z.M { err = en.WriteString(za0001) if err != nil { err = msgp.WrapError(err, "M") return } // map header, size 0 err = en.Append(0x80) if err != nil { return } } return }
where za0002 is unused and causes the code to not compile
The text was updated successfully, but these errors were encountered:
Add map[string]struct{} support
428170d
Empty structs used as map values would generate invalid code. Fixes tinylib#298
Add map[string]struct{} support (#339)
db2e247
Empty structs used as map values would generate invalid code. Fixes #298
Successfully merging a pull request may close this issue.
If there's a
map[string]struct{}
field in a struct, the generated code will not compileEg:
produces
where za0002 is unused and causes the code to not compile
The text was updated successfully, but these errors were encountered: