go-restruct / restruct

Rich binary (de)serialization library for Golang
https://restruct.io/
ISC License
360 stars 17 forks source link

Implement decoding and encoding of boolean values. #28

Closed jchv closed 5 years ago

jchv commented 5 years ago

It would appear that neither the encoder nor decoder attempt to handle booleans.

Proposed behavior:

CBool   bool                    // would be decoded as an 8-bit boolean, like C.
1Bit    bool `struct:"uint8:1"` // single bit boolean
1BitAlt bool `struct:"bool:1"`  // another single bit boolean
32Bit   bool `struct:"uint32"`  // 32-bit integer boolean