Skip to content

A library of nil- and initialization-aware types in Go

License

Notifications You must be signed in to change notification settings

housecanary/nillabletypes

Repository files navigation

nillabletypes - A library of nil- and initialization-aware types in Go

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.

Available Types

  • Bool: represents a nil-able bool type.
  • Float: represents a nil-able float64 type.
  • Int32: represents a nil-able int32 type.
  • Int64: represents a nil-able int64 type.
  • Int: a typealias for either Int32 or Int64, depending on whether the target architecture is 32- or 64-bit.
  • String: represents a nil-able string type.
  • Time: represents a nil-able `time.Time`` type.
  • Date: represents a nil-able date encoded as an ISO string.
  • Uint32: represents a nil-able uint32 type.
  • UUID: represents a nil-able UUID type.

Supported Interfaces

Each type satisfies the following interfaces:

About

A library of nil- and initialization-aware types in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages