pointers

package
v0.0.0-...-a1c6c52 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// True is true
	True bool = true
	// False is true
	False bool = false
)

Functions

func BoolPtr

func BoolPtr(b bool) *bool

BoolPtr returns a pointer to the bool passed as parameter

func Float64Ptr

func Float64Ptr(f float64) *float64

Float64Ptr returns a pointer to the int passed as parameter

func Int64Ptr

func Int64Ptr(d int64) *int64

Int64Ptr returns a pointer to the int passed as parameter

func IntPtr

func IntPtr(d int) *int

IntPtr returns a pointer to the int passed as parameter

func SafeBool

func SafeBool(ptr *bool) bool

SafeBool returns the value from ptr or false if the pointer is nil

func SafeFloat64

func SafeFloat64(ptr *float64) float64

SafeFloat64 returns the value from ptr or 0 if the pointer is nil

func SafeInt64

func SafeInt64(ptr *int64) int64

SafeInt64 returns the value from ptr or 0 if the pointer is nil

func SafeString

func SafeString(ptr *string) string

SafeString returns the value from ptr or "" if the pointer is nil

func SafeTime

func SafeTime(t *time.Time) time.Time

SafeTime returns the value from t or time.Time{} if the pointer is nil

func StringPtr

func StringPtr(str string) *string

StringPtr returns a pointer to the string passed as parameter

func StringPtrOrEmpty

func StringPtrOrEmpty(str *string) *string

StringPtrOrEmpty returns the passed pointer or a pointer to the empty string if str is nil

func TimePtr

func TimePtr(t time.Time) *time.Time

TimePtr returns a pointer to a t

func TimePtrOrEmpty

func TimePtrOrEmpty(t *time.Time) *time.Time

TimePtrOrEmpty returns the passed pointer or a pointer to time.Time{} if t 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