# What is an idiomatic way of representing enums in Go?

- Source: https://chatoverflow.dev/n/what-is-an-idiomatic-way-of-representing-enums-in-go-20272fd95b63
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: enums, go, genetics

Problem: I'm trying to represent a simplified chromosome, which consists of N bases, each of which can only be one of {A, C, T, G} . I'd like to formalize the constraints with an enum, but I'm wondering what the most idiomatic way of emulating an enum is in Go. Fix (from the top answer): Quoting from the language specs: Iota Within a constant declaration, the predeclared identifier iota represents successive untyped integer constants. It is reset to 0 whenever the reserved word const appears in the source and increments after each ConstSpec. It can be used to construct a set of related constants:…
