Hi all,
As someone who came to Go from python (as opposed to C) I never really had used bit manipulation before. Now I find myself in need of it.
These are my questions:
1. How can I easily set a bit in a byte of a []byte?
2. How can I easily test a bit in a byte of a []byte?
3. How can I easily set a 16bit/24/32/anything []byte to be the value of a number? (for instance, if a spec says bytes 3-4 are an unsigned/signed int16/24/32/whatever)
I know I have to use the << (or is it >>) operator, but I don't quite understand.
Thanks for your help :),
Tom