Documentation ¶
Index ¶
- Variables
- func AllPtrFieldsNil(obj interface{}) bool
- func Bool(b bool) *bool
- func BoolDeref(ptr *bool, def bool) bool
- func BoolEqual(a, b *bool) bool
- func Duration(d time.Duration) *time.Duration
- func DurationDeref(ptr *time.Duration, def time.Duration) time.Duration
- func DurationEqual(a, b *time.Duration) bool
- func Float32(i float32) *float32
- func Float32Deref(ptr *float32, def float32) float32
- func Float32Equal(a, b *float32) bool
- func Float64(i float64) *float64
- func Float64Deref(ptr *float64, def float64) float64
- func Float64Equal(a, b *float64) bool
- func Int(i int) *int
- func Int32(i int32) *int32
- func Int32Deref(ptr *int32, def int32) int32
- func Int32Equal(a, b *int32) bool
- func Int64(i int64) *int64
- func Int64Deref(ptr *int64, def int64) int64
- func Int64Equal(a, b *int64) bool
- func IntDeref(ptr *int, def int) int
- func String(s string) *string
- func StringDeref(ptr *string, def string) string
- func StringEqual(a, b *string) bool
- func Uint(i uint) *uint
- func Uint32(i uint32) *uint32
- func Uint32Deref(ptr *uint32, def uint32) uint32
- func Uint32Equal(a, b *uint32) bool
- func Uint64(i uint64) *uint64
- func Uint64Deref(ptr *uint64, def uint64) uint64
- func Uint64Equal(a, b *uint64) bool
- func UintDeref(ptr *uint, def uint) uint
Constants ¶
This section is empty.
Variables ¶
var BoolPtr = Bool // for back-compat
BoolPtr is a function variable referring to Bool. Deprecated: Use Bool instead.
var BoolPtrDerefOr = BoolDeref // for back-compat
BoolPtrDerefOr is a function variable referring to BoolDeref. Deprecated: Use BoolDeref instead.
var Float32Ptr = Float32
Float32Ptr is a function variable referring to Float32. Deprecated: Use Float32 instead.
var Float32PtrDerefOr = Float32Deref // for back-compat
Float32PtrDerefOr is a function variable referring to Float32Deref. Deprecated: Use Float32Deref instead.
var Float64Ptr = Float64
Float64Ptr is a function variable referring to Float64. Deprecated: Use Float64 instead.
var Float64PtrDerefOr = Float64Deref // for back-compat
Float64PtrDerefOr is a function variable referring to Float64Deref. Deprecated: Use Float64Deref instead.
var Int32Ptr = Int32 // for back-compat
Int32Ptr is a function variable referring to Int32. Deprecated: Use Int32 instead.
var Int32PtrDerefOr = Int32Deref // for back-compat
Int32PtrDerefOr is a function variable referring to Int32Deref. Deprecated: Use Int32Deref instead.
var Int64Ptr = Int64 // for back-compat
Int64Ptr is a function variable referring to Int64. Deprecated: Use Int64 instead.
var Int64PtrDerefOr = Int64Deref // for back-compat
Int64PtrDerefOr is a function variable referring to Int64Deref. Deprecated: Use Int64Deref instead.
var IntPtr = Int // for back-compat
IntPtr is a function variable referring to Int. Deprecated: Use Int instead.
var IntPtrDerefOr = IntDeref // for back-compat
IntPtrDerefOr is a function variable referring to IntDeref. Deprecated: Use IntDeref instead.
var StringPtr = String // for back-compat
StringPtr is a function variable referring to String. Deprecated: Use String instead.
var StringPtrDerefOr = StringDeref // for back-compat
StringPtrDerefOr is a function variable referring to StringDeref. Deprecated: Use StringDeref instead.
var Uint32Ptr = Uint32 // for back-compat
Uint32Ptr is a function variable referring to Uint32. Deprecated: Use Uint32 instead.
var Uint32PtrDerefOr = Uint32Deref // for back-compat
Uint32PtrDerefOr is a function variable referring to Uint32Deref. Deprecated: Use Uint32Deref instead.
var Uint64Ptr = Uint64 // for back-compat
Uint64Ptr is a function variable referring to Uint64. Deprecated: Use Uint64 instead.
var Uint64PtrDerefOr = Uint64Deref // for back-compat
Uint64PtrDerefOr is a function variable referring to Uint64Deref. Deprecated: Use Uint64Deref instead.
var UintPtr = Uint // for back-compat
UintPtr is a function variable referring to Uint. Deprecated: Use Uint instead.
var UintPtrDerefOr = UintDeref // for back-compat
UintPtrDerefOr is a function variable referring to UintDeref. Deprecated: Use UintDeref instead.
Functions ¶
func AllPtrFieldsNil ¶
func AllPtrFieldsNil(obj interface{}) bool
AllPtrFieldsNil tests whether all pointer fields in a struct are nil. This is useful when, for example, an API struct is handled by plugins which need to distinguish "no plugin accepted this spec" from "this spec is empty".
This function is only valid for structs and pointers to structs. Any other type will cause a panic. Passing a typed nil pointer will return true.
func BoolDeref ¶
BoolDeref dereferences the bool ptr and returns it if not nil, or else returns def.
func BoolEqual ¶
BoolEqual returns true if both arguments are nil or both arguments dereference to the same value.
func DurationDeref ¶
DurationDeref dereferences the time.Duration ptr and returns it if not nil, or else returns def.
func DurationEqual ¶
DurationEqual returns true if both arguments are nil or both arguments dereference to the same value.
func Float32Deref ¶
Float32Deref dereferences the float32 ptr and returns it if not nil, or else returns def.
func Float32Equal ¶
Float32Equal returns true if both arguments are nil or both arguments dereference to the same value.
func Float64Deref ¶
Float64Deref dereferences the float64 ptr and returns it if not nil, or else returns def.
func Float64Equal ¶
Float64Equal returns true if both arguments are nil or both arguments dereference to the same value.
func Int32Deref ¶
Int32Deref dereferences the int32 ptr and returns it if not nil, or else returns def.
func Int32Equal ¶
Int32Equal returns true if both arguments are nil or both arguments dereference to the same value.
func Int64Deref ¶
Int64Deref dereferences the int64 ptr and returns it if not nil, or else returns def.
func Int64Equal ¶
Int64Equal returns true if both arguments are nil or both arguments dereference to the same value.
func StringDeref ¶
StringDeref dereferences the string ptr and returns it if not nil, or else returns def.
func StringEqual ¶
StringEqual returns true if both arguments are nil or both arguments dereference to the same value.
func Uint32Deref ¶
Uint32Deref dereferences the uint32 ptr and returns it if not nil, or else returns def.
func Uint32Equal ¶
Uint32Equal returns true if both arguments are nil or both arguments dereference to the same value.
func Uint64Deref ¶
Uint64Deref dereferences the uint64 ptr and returns it if not nil, or else returns def.
func Uint64Equal ¶
Uint64Equal returns true if both arguments are nil or both arguments dereference to the same value.
Types ¶
This section is empty.