Skip to content

Instantly share code, notes, and snippets.

@corsc
Created September 17, 2014 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corsc/1b170702c8188e07f892 to your computer and use it in GitHub Desktop.
Save corsc/1b170702c8188e07f892 to your computer and use it in GitHub Desktop.
Example of Enums in Go
// Color is a custom type (enum) to improve my code readibility
type Color int64
// The list of of all possible "enum" values
const (
RED color = iota
BLUE
GREEN
WHITE
BLACK
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment