Golang, a strong-typed language allows the ability to group constants together in parenthesis with the iota keyword. But coupling that with a string representation can add extra boilerplate code. Let’s first take a look at how constants and enums are created in Go.
A recap on constants and enums in Go…
For example, as constants by placing them in parenthesis:
const ( Dog = 0 Cat = 1 Bird = 2 )
Using the iota keyword to make an enum:
const ( Dog = iota Cat Bird
IntelliJ. Don’t get me wrong I’m a big fan of Sublime but mainly use it for Markdown, Javascript and Python. I wanted try Go in one of the IDE’s I was familiar with.