Re:Go: What We Got Right, What We Got Wrong
by campbel on Friday January 05, 2024 @01:58PM
(#38883107)
Couldn't we do an optional type with the type system as is rather than embedding in the language?
type Optional[V any] struct { IsSet bool Value V }
One could have easily added an Optional type that forces programmers to check for nil every time the optional variable is accessed.