proxy.golang.org : github.com/Southclaws/opt
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.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/%21southclaws/opt
Keywords:
functional-programming
, go
, golang
, maybe-type
, optional
, optional-type
License: MIT
Latest release: over 1 year ago
First release: over 2 years ago
Namespace: github.com/Southclaws
Stars: 29 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 1 day ago