Documentation ¶
Overview ¶
bitmasks are a way to store multiple boolean values in a single integer
Example ¶
package main import ( "fmt" "simonwaldherr.de/go/golibs/bitmask" ) func main() { i := bitmask.New(0b11111111) i.Set(0, false) fmt.Println(i) i.Set(3, false) fmt.Println(i) i.Set(0, true) fmt.Println(i) fmt.Println("2:", i.Get(2)) fmt.Printf("[]byte: %b\n", i.Byte()) }
Output: 11111110 11110110 11110111 2: true []byte: [11110111]
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.