github.com/Southclaws/opt (go): Package opt provides an optional type for expressing the possibility of a value being present or not. It's more ergonomic than pointers as it forces you to use accessor methods instead of dereferencing, removing the risk of a nil pointer dereference.  There are also utilities for mapping the optional type to another type if it is present, constructing optional types from pointers and getting a pointer to the optional value or nil for easy usage with APIs that accept pointers.  Note that some APIs are not implemented as methods due to the way that Go's generics are designed. This may change in future Go versions if it becomes possible to write a method of some type T which takes additional type params.
Keywords: functional-programming|go|golang|maybe-type|optional|optional-type