Its easy to use bit flag operations. But more easy i think is to use a small library for this, a library like this: https://github.com/albulescu/go-bitflag
luni, 17 februarie 2014, 23:29:06 UTC+2, bsr a scris: > > Hello, > > I hate to ask this question without a "play" link, but I am not sure where > to begin in terms of data type to use. I am in need of some flags, which > currently are represented as bool. Since these would be part of many data > points, to save space, I was thinking to use bit representation and masking > them to get the flag status. For say, 8 flags, can you please show an > example where I can set these bits and read them back. > > Thanks > bsr > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.