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 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
Constants ¶
This section is empty.
Variables ¶
var BoolPtr = Bool // for back-compat
var BoolPtrDerefOr = BoolDeref // for back-compat
var Float32Ptr = Float32
var Float32PtrDerefOr = Float32Deref // for back-compat
var Float64Ptr = Float64
var Float64PtrDerefOr = Float64Deref // for back-compat
var Int32Ptr = Int32 // for back-compat
var Int32PtrDerefOr = Int32Deref // for back-compat
var Int64Ptr = Int64 // for back-compat
var Int64PtrDerefOr = Int64Deref // for back-compat
var IntPtr = Int // for back-compat
var IntPtrDerefOr = IntDeref // for back-compat
var StringPtr = String // for back-compat
var StringPtrDerefOr = StringDeref // for back-compat
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 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.
Types ¶
This section is empty.