DEV Community

Discussion on: Constants in Go.

Collapse
 
plutov profile image
Alex Pliutau • Edited

I also use often iota for constants, so it's helpful to set values in order. For example:

const (
    TypicalNoob Stereotype = iota // 0
    TypicalHipster                // 1
    TypicalUnixWizard             // 2
    TypicalStartupFounder         // 3
)