Documentation ¶
Index ¶
- func Bool(b *bool) bool
- func Float32(i *float32) float32
- func Float64(i *float64) float64
- func Int(i *int) int
- func Int32(i *int32) int32
- func Int64(i *int64) int64
- func Ptr[T any](v T) *T
- func SliceOfPtrs[T any](vv ...T) []*T
- func String(s *string) string
- func StringMap(msp map[string]*string) map[string]string
- func StringMapPtr(ms map[string]string) *map[string]*string
- func StringSlice(s *[]string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool returns the boolean value of the pointer passed in, or false if the pointer is nil.
func Float32 ¶
Float32 returns the value of the float32 pointer if it is not nil, otherwise it returns 0.0.
func Float64 ¶
Float64 returns the value of the float64 pointer if it is not nil, otherwise it returns 0.0.
func Int32 ¶
Int32 checks if the pointer to an int32 is nil and returns the int32 value if it is not nil, otherwise it returns 0.
func Ptr ¶
func Ptr[T any](v T) *T
Ptr takes in a value of any type and returns a pointer to that value.
func SliceOfPtrs ¶
func SliceOfPtrs[T any](vv ...T) []*T
SliceOfPtrs takes in a variable number of arguments of any type and returns a slice of pointers to those arguments.
func String ¶
String returns the string pointed to by s if s is not nil, otherwise it returns an empty string.
func StringMap ¶
StringMap takes in a map of strings and pointers to strings and returns a map of strings with empty strings in place of nil pointers.
func StringMapPtr ¶
StringMapPtr creates a new map with string keys and pointer values from an existing map with string keys and string values.
func StringSlice ¶
StringSlice returns a string slice value for the passed string slice pointer. It returns a nil slice if the pointer is nil.
Types ¶
This section is empty.