nillabletypes is a library of Go types that provide nil and initialized states.
The nil state is useful when you'd like to communicate that a scalar value does not exist.
The initialized state is useful when you'd like to ensure that a variable's value has been set, typically after you pass an existing variable by reference to some other function.
Bool
: represents a nil-ablebool
type.Float
: represents a nil-ablefloat64
type.Int32
: represents a nil-ableint32
type.Int64
: represents a nil-ableint64
type.Int
: a typealias for either Int32 or Int64, depending on whether the target architecture is 32- or 64-bit.String
: represents a nil-ablestring
type.Time
: represents a nil-able `time.Time`` type.Date
: represents a nil-able date encoded as an ISO string.Uint32
: represents a nil-ableuint32
type.UUID
: represents a nil-ableUUID
type.
Each type satisfies the following interfaces: