Documentation
¶
Index ¶
- func DefaultIfNil[T any](ptr *T, defaultVal T) T
- func NullableBool(b *bool) bool
- func NullableByteSlice(b *[]byte) []byte
- func NullableComplex64(c *complex64) complex64
- func NullableComplex128(c *complex128) complex128
- func NullableFloat32(f *float32) float32
- func NullableFloat64(f *float64) float64
- func NullableInt(i *int) int
- func NullableInt8(i *int8) int8
- func NullableInt16(i *int16) int16
- func NullableInt32(i *int32) int32
- func NullableInt64(i *int64) int64
- func NullableString(s *string) string
- func NullableTime(t *time.Time) time.Time
- func NullableUint(i *uint) uint
- func NullableUint8(i *uint8) uint8
- func NullableUint16(i *uint16) uint16
- func NullableUint32(i *uint32) uint32
- func NullableUint64(i *uint64) uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIfNil ¶
func DefaultIfNil[T any](ptr *T, defaultVal T) T
DefaultIfNil returns the value of the pointer if it is not nil, or the default value if the pointer is nil
func NullableBool ¶
NullableBool returns the value of the bool pointer or false if the pointer is nil
func NullableByteSlice ¶
NullableByteSlice returns the dereferenced value of *[]byte if not nil, or an empty byte slice otherwise.
func NullableComplex64 ¶
NullableComplex64 returns the dereferenced value of *complex64 if not nil, or 0+0i otherwise.
func NullableComplex128 ¶
func NullableComplex128(c *complex128) complex128
NullableComplex128 returns the dereferenced value of *complex128 if not nil, or 0+0i otherwise.
func NullableFloat32 ¶
NullableFloat32 returns the dereferenced value of *float32 if not nil, or 0.0 otherwise.
func NullableFloat64 ¶
NullableFloat64 returns the dereferenced value of *float64 if not nil, or 0.0 otherwise.
func NullableInt ¶
NullableInt returns the dereferenced value of the int pointer or 0 if the pointer is nil
func NullableInt8 ¶
NullableInt8 returns the dereferenced value of *int8 if not nil, or 0 otherwise.
func NullableInt16 ¶
NullableInt16 returns the dereferenced value of *int16 if not nil, or 0 otherwise.
func NullableInt32 ¶
NullableInt32 returns the dereferenced value of *int32 if not nil, or 0 otherwise.
func NullableInt64 ¶
NullableInt64 returns the dereferenced value of *int64 if not nil, or 0 otherwise.
func NullableString ¶
NullableString returns the value of the string pointer or an empty string if the pointer is nil
func NullableTime ¶
NullableTime returns the dereferenced value of *time.Time if not nil, or a zero time.Time otherwise.
func NullableUint ¶
NullableUint returns the dereferenced value of *uint if not nil, or 0 otherwise.
func NullableUint8 ¶
NullableUint8 returns the dereferenced value of *uint8 if not nil, or 0 otherwise.
func NullableUint16 ¶
NullableUint16 returns the dereferenced value of *uint16 if not nil, or 0 otherwise.
func NullableUint32 ¶
NullableUint32 returns the dereferenced value of *uint32 if not nil, or 0 otherwise.
func NullableUint64 ¶
NullableUint64 returns the dereferenced value of *uint64 if not nil, or 0 otherwise.
Types ¶
This section is empty.