As I understand go does not support binary literals such as 0b01101100
.
The discussions so far mention two workarounds, either use strtoul
or define consts such as b01101100
(works for 8bit, afterwards it becomes silly).
Benefits of literals:
- makes certain code way more readable (yes I can convert to hex in my head, but it’s non-obvious to the reader)
- allows untyped consts (compared to
strtoul
)
Drawbacks:
- yet another literal
Are there any plans for binary literals? Or is there a compelling reason not to have them?