The nullable
package provides a number of types that represent values
that may be null. The standard Go library already includes types in the
database/sql
package for this purpose including NullBool
,
NullFloat64
, NullInt64
and NullString
.
The types in this package add to this list for convenience. The other
significant difference is that the types in this package all implement
the json.Marshaler
and json.Unmarshaler
interfaces, which are
used for serializing to and from JSON.