Documentation ¶
Overview ¶
Package opt contains a set of optional types. Optional types provide programmers with a better means of distinguishing a value's "is set" state compared to using a possibly-nil pointer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
Bool is an optional type that wraps a bool.
func (Bool) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Byte ¶
type Byte struct {
// contains filtered or unexported fields
}
Byte is an optional type that wraps a byte.
func (Byte) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Complex128 ¶
type Complex128 struct {
// contains filtered or unexported fields
}
Complex128 is an optional type that wraps a complex128.
func MakeComplex128 ¶
func MakeComplex128(v complex128) Complex128
MakeComplex128 creates a new Complex128 with the specified value.
func (Complex128) Get ¶
func (p Complex128) Get() complex128
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
func (Complex128) IsSet ¶
func (p Complex128) IsSet() bool
IsSet returns a value indicating whether the optional type's value is set.
type Complex64 ¶
type Complex64 struct {
// contains filtered or unexported fields
}
Complex64 is an optional type that wraps a complex64.
func MakeComplex64 ¶
MakeComplex64 creates a new Complex64 with the specified value.
func (Complex64) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Float32 ¶
type Float32 struct {
// contains filtered or unexported fields
}
Float32 is an optional type that wraps a float32.
func MakeFloat32 ¶
MakeFloat32 creates a new Float32 with the specified value.
func (Float32) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Float64 ¶
type Float64 struct {
// contains filtered or unexported fields
}
Float64 is an optional type that wraps a float64.
func MakeFloat64 ¶
MakeFloat64 creates a new Float64 with the specified value.
func (Float64) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int is an optional type that wraps a int.
func (Int) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Int16 ¶
type Int16 struct {
// contains filtered or unexported fields
}
Int16 is an optional type that wraps a int16.
func (Int16) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Int32 ¶
type Int32 struct {
// contains filtered or unexported fields
}
Int32 is an optional type that wraps a int32.
func (Int32) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Int64 ¶
type Int64 struct {
// contains filtered or unexported fields
}
Int64 is an optional type that wraps a int64.
func (Int64) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Int8 ¶
type Int8 struct {
// contains filtered or unexported fields
}
Int8 is an optional type that wraps a int8.
func (Int8) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Rune ¶
type Rune struct {
// contains filtered or unexported fields
}
Rune is an optional type that wraps a rune.
func (Rune) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String is an optional type that wraps a string.
func MakeString ¶
MakeString creates a new String with the specified value.
func (String) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Uint ¶
type Uint struct {
// contains filtered or unexported fields
}
Uint is an optional type that wraps a uint.
func (Uint) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Uint16 ¶
type Uint16 struct {
// contains filtered or unexported fields
}
Uint16 is an optional type that wraps a uint16.
func MakeUint16 ¶
MakeUint16 creates a new Uint16 with the specified value.
func (Uint16) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
Uint32 is an optional type that wraps a uint32.
func MakeUint32 ¶
MakeUint32 creates a new Uint32 with the specified value.
func (Uint32) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Uint64 ¶
type Uint64 struct {
// contains filtered or unexported fields
}
Uint64 is an optional type that wraps a uint64.
func MakeUint64 ¶
MakeUint64 creates a new Uint64 with the specified value.
func (Uint64) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.
type Uint8 ¶
type Uint8 struct {
// contains filtered or unexported fields
}
Uint8 is an optional type that wraps a uint8.
func (Uint8) Get ¶
Get returns the underlying value wrapped by the optional type. If IsSet returns false, then Get's return value will be the zero value for the underlying type.