Johnny.sh

ENUM in Go

Ha, sike! Go doesn’t have an enum primitive as part of the language!! This is one common gripe about the language.

There are a few patterns that you can utilize to get similar behavior to enum. For example:

Last modified: November 16, 2022
/about
/uses
/notes
/talks
/projects
/podcasts
/reading-list
/spotify
© 2024