Clever trick using the iota keyword (used for enum-like behavior in Go):
const (
a = 1 << iota // a == 1
b = 1 << iota // b == 2
c = 1 << iota // c == 4
)
Thanks to this related SO post.
Clever trick using the iota keyword (used for enum-like behavior in Go):
const (
a = 1 << iota // a == 1
b = 1 << iota // b == 2
c = 1 << iota // c == 4
)
Thanks to this related SO post.