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
Go's GetBool() function checks whether a byte is == 1
// GetBool decodes a little-endian bool from a byte slice.funcGetBool(buf []byte) bool {
returnbuf[0] ==1
}
This is inconsistent with rust, C++, PHP, Python and is not what I think of as the usual convention of integer-to-boolean conversion.
Alternatively: it could be made explicit that the only legal values for bytes storing booleans are 0 and 1; currently the internals doc is not explicit and no verifiers I have looked at will reject a boolean of (say) 2.
The text was updated successfully, but these errors were encountered:
During encoding, `Field.nullable` was not coerced to 0 or 1 (I was
expecting `flatcc` to do that). However the Go reader recognizes
anything other than `Field.nullable == 1` as a non-nullable field
google/flatbuffers#8389
some typos and better error messages are included
Go's
GetBool()
function checks whether a byte is == 1This is inconsistent with rust, C++, PHP, Python and is not what I think of as the usual convention of integer-to-boolean conversion.
Alternatively: it could be made explicit that the only legal values for bytes storing booleans are 0 and 1; currently the internals doc is not explicit and no verifiers I have looked at will reject a boolean of (say) 2.
The text was updated successfully, but these errors were encountered: