Lack of Enums
One notable absence in Go’s type system is a native enum (enumerated type) or sum type (like Rust’s Result or Option).
Simplicity over Expressiveness
Go’s design philosophy favors simplicity and readability over the complex type-level guarantees found in languages like Rust, TypeScript, or OCaml. While these languages can force developers to handle every possible case of a type at compile time, Go relies more on developer discipline and conventional error handling.
Error Handling Comparison
In Rust, an error is part of a Result enum. You literally cannot access the “success” value without first handling the possibility of an “error” case.
In Go, an error is just a value returned alongside your data:
user, err := getUser()
if err != nil {
// handle error
}
The Go compiler will not stop you from ignoring err and trying to use user (which might be nil), leading to potential runtime panics. This “loose” approach is a conscious trade-off for a simpler, less restrictive language.