On Thu, Feb 12, 2015 at 9:09 AM, Sander van Harmelen <
san...@xanzy.io> wrote:
> It seems that the smallest type I can define is a byte/int8 which is 8bits.
> Is there a way to define a const or custom type of 4bits?
No there isn't since you can't actually address 4 bits.
You can use bit shifting/bit masking to store two 4bit values in a byte.
Eg.
http://golang.org/pkg/os/#FileMode stores various values in a single uint32