package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Apr 25, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Null[T any] struct {
}
Null is a generic type that represents a nullable value.
There are 2 possible states:
- Null:
> value: zero value of T
> valid: false
- Not Null:
> value: value of T
> valid: true
Constructors
None returns a Null[T] with valid set to false.
Some returns a Null[T] with valid set to true.
Methods
- Inspection
IsNull returns true if the Null is in a Null state.
func (n Null[T]) Unwrap() T
- Fetching
Unwrap returns the inner value of a Not Null.
If the Null is in a Null state, Unwrap panics.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.