github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/binary/binary.go (about) 1 // For license and copyright information please see LEGAL file in repository 2 3 package binary 4 5 func Bool(b []byte) bool { return b[0] != 0 } 6 func Uint8(b []byte) uint8 { return uint8(b[0]) } 7 8 func PutBool(b []byte, v bool) { 9 if v { 10 b[0] = 1 11 } else { 12 b[0] = 0 13 } 14 } 15 func PutUint8(b []byte, v uint8) { 16 b[0] = v 17 }