Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
Bool is a nullable bool. It does not consider false values to be null. It will decode to null, not false, if null.
func (Bool) IsZero ¶
IsZero returns true for invalid Bools, for future omitempty support (Go 1.4?). A non-null Bool with a 0 value will not be considered zero.
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Bool. It also supports unmarshalling a sql.NullBool.
type Int ¶
Int is an nullable int64. It does not consider zero values to be null. It will decode to null, not zero, if null.
func (Int) IsZero ¶
IsZero returns true for invalid Ints, for future omitempty support (Go 1.4?). A non-null Int with a 0 value will not be considered zero.
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Int. It also supports unmarshalling a sql.NullInt64.
type String ¶
type String struct {
sql.NullString
}
String is a nullable string. It supports SQL and JSON serialization. It will marshal to null if null. Blank string input will be considered null.
func (String) IsZero ¶
IsZero returns true for null strings, for potential future omitempty support.
func (*String) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string and null input. Blank string input does not produce a null String. It also supports unmarshalling a sql.NullString.