go-sumtype

A simple utility for running exhaustiveness checks on Go "sum types." (by BurntSushi)

Go-sumtype Alternatives

Similar projects and alternatives to go-sumtype

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better go-sumtype alternative or higher similarity.

go-sumtype reviews and mentions

Posts with mentions or reviews of go-sumtype. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-13.
  • Small sum types in Golang
    1 project | dev.to | 21 Jun 2023
    I find this implementation to be quite minimal and less clumsy than alternatives. Sure, you don't get nice exhaustive pattern matching. Also, type inference gets in the way when instantiating UserKey (though you can wrap it in constructor functions). But expressing your intent using types still makes your code much more convenient and easier to understand.
  • Switching from C++ to Rust
    7 projects | news.ycombinator.com | 13 Mar 2023
    The call out to sum types is something I feel. I've been using Rust daily for almost 10 years now, and sum types are absolutely still one of the things I love most about it. It's easily one of the things I miss the most in other languages. I'm usually a proponent of "using languages as they're intended," but I missed exhaustiveness checking so much that I ported a version of it to Go[1] as a sort of lint.

    [1]: https://github.com/BurntSushi/go-sumtype

  • Rusty enums in Go
    5 projects | /r/golang | 16 Feb 2023
    A Google search for golang sum types currently shows my project as a second hit: https://github.com/BurntSushi/go-sumtype
  • Carbon Language: An experimental successor to C++
    11 projects | /r/rust | 19 Jul 2022
    I've been writing Go and Rust nearly daily for about a decade now (Go is more than a decade, Rust is about 8 years). You are not going to teach me anything about the pros and cons of either language in a reddit comment. I do not need to be taught about the "iota mess" when I've written tooling for exhaustiveness checking in Go.
  • a go linter to check switch statements for default
    3 projects | /r/golang | 25 May 2022
    https://github.com/BurntSushi/go-sumtype forces exhaustive type switches for interfaces specifically annotated to need that.
  • Go: Making state explicit using the type system
    2 projects | dev.to | 15 May 2022
    We can fix these two problems by relying on static analyzers such as go-sumtypes
  • Hacking sum types with Go generics
    2 projects | /r/golang | 14 Mar 2022
    See also https://github.com/BurntSushi/go-sumtype
  • What I'd like to see in Go 2.0
    11 projects | news.ycombinator.com | 4 Feb 2022
  • Upcoming Features in Go 1.18
    3 projects | news.ycombinator.com | 9 Nov 2021
    go-sumtype[0] has completeness checking for sealed interfaces.

    [0] https://github.com/BurntSushi/go-sumtype

  • I want enum more than generics
    2 projects | /r/golang | 13 Jan 2021
    Pretty easy to achieve outside of the compiler: https://github.com/BurntSushi/go-sumtype
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 24 Apr 2024
    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. Learn more →

Stats

Basic go-sumtype repo stats
11
403
0.0
about 1 year ago

BurntSushi/go-sumtype is an open source project licensed under The Unlicense which is not an OSI approved license.

The primary programming language of go-sumtype is Go.


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com