Compile-time safety for enumerations in Go

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • exhaustive

    Check exhaustiveness of switch statements of enum-like constants in Go source code.

  • This is an analyzer that will catch this: https://github.com/nishanths/exhaustive

    I believe it's in golangci-lint.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • go

    The Go programming language

  • https://github.com/golang/go/issues/57644

    As stated in that proposal, the interaction between what people want from “enums,” “discriminated unions,” “sum types,” (as well as “optional values” and “nil safety”) and fundamental Go tenets like zero values, make this a tough sell, which is very likely to make no one happy.

  • go-enum-example

    Go Enum: benchmarks, examples, analysis

  • interesting approach! but I typically use this method for type constraints.

    for enums I prefer just direct structs: https://github.com/nikolaydubina/go-enum-example

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

  • Rusty enums in Go

    5 projects | /r/golang | 16 Feb 2023
  • Why people are angry over Go 1.23 Iterators

    1 project | news.ycombinator.com | 18 Jun 2024
  • Function fitting in Go

    1 project | dev.to | 14 Jun 2024
  • Criando um modulo xk6 para k6

    3 projects | dev.to | 13 Jun 2024
  • Orbail proposal for go error handling

    1 project | news.ycombinator.com | 12 Jun 2024