How do I manipulate binary numbers in GO?

If you know them at “development time” use 0b prefixed nuimeric constants as in this example:

https://play.golang.org/p/X9iVtsZruuF

There is also the strconv pacakge, which provides functionality to parse strings in any base you like.

1 Like