Why are enums not a thing in Go?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • SaaSHub - Software Alternatives and Reviews
  • go

    The Go programming language

    There have been many proposals to add enums. The earliest I found is this (2017), but they are still debating if it's worth "the complexity".

  • enumeration

    Enumerations for Go - a really useful yet easy-to-use code generator (by rickb777)

    I regularly use a tool I maintain (that I derived from others' work) that generates the enums I need for me. (https://github.com/rickb777/enumeration)

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • enumcheck

    Allows to mark Go enum types as exhaustive.

    closed set of enumerated values/types; use a linter, e.g. enumcheck

  • texpack

    Texture packer with image, font and sdf support.

    enumerated set based on file tree; similarly, code generator can help (e.g. see texture packing)

  • exhaustive

    Check exhaustiveness of switch statements of enum-like constants.

    Use a linter.

  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts