Can't wait for the thing to land. My only remaining wish is sum types
There isn't anything wrong with a language just not jiving with your sensibilities.
You can define an interface with a closed set of types
type Number interface { float64, int64, ... }
Now, the value will be boxed, so you will not have no-allocation sum types but you can approximate boxed sum types with this I think.
The main thing that's lacking is compile time checks whether variant matching is exhaustive.
func ThrowIfError(err error) {
if err != nil {
panic(err)
}
}
// ....
name, err := FuncWithError()
ThrowIfError(err)