to

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b *bool) bool

Bool returns the boolean value of the pointer passed in, or false if the pointer is nil.

func Float32

func Float32(i *float32) float32

Float32 returns the value of the float32 pointer if it is not nil, otherwise it returns 0.0.

func Float64

func Float64(i *float64) float64

Float64 returns the value of the float64 pointer if it is not nil, otherwise it returns 0.0.

func Int

func Int(i *int) int

Int returns the value of the pointer if it is not nil, otherwise it returns 0.

func Int32

func Int32(i *int32) 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 Int64

func Int64(i *int64) int64

Int64 returns the int64 value of the pointer passed in, or 0 if the pointer is nil.

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

func String(s *string) string

String returns the string pointed to by s if s is not nil, otherwise it returns an empty string.

func StringMap

func StringMap(msp map[string]*string) map[string]string

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

func StringMapPtr(ms map[string]string) *map[string]*string

StringMapPtr creates a new map with string keys and pointer values from an existing map with string keys and string values.

func StringSlice

func StringSlice(s *[]string) []string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL