Help us shape the future of Go! Take the 2026 Go Developer Survey

pointer

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(v *bool) bool

GetBool returns the value of v, if v is nil, returns def.

func GetInt32

func GetInt32(v *int32) int32

GetInt32 returns the value of the pointer if it's not nil, otherwise returns 0.

func GetInt64

func GetInt64(v *int64) int64

GetInt64 returns the value of the pointer if it's not nil, otherwise returns 0.

func GetString

func GetString(s *string) string

GetString returns the string value of the pointer.

func GetUint32

func GetUint32(v *uint32) uint32

GetUint32 returns the value of the pointer if it's not nil, otherwise returns 0.

func ToBoolPtr

func ToBoolPtr(v bool) *bool

ToBoolPtr returns a pointer to the value.

func ToBoolPtrIfNotFalse

func ToBoolPtrIfNotFalse(v bool) *bool

ToBoolPtrIfNotFalse returns a pointer to the value if it's not false, otherwise returns nil.

func ToInt32Ptr

func ToInt32Ptr(v int32) *int32

ToInt32Ptr returns a pointer to the value.

func ToInt32PtrIfNotZero

func ToInt32PtrIfNotZero(v int32) *int32

func ToInt64Ptr

func ToInt64Ptr(v int64) *int64

ToInt64Ptr returns a pointer to the value.

func ToInt64PtrIfNotNil

func ToInt64PtrIfNotNil(v int64) *int64

ToInt64PtrIfNotNil returns a pointer to the int64 value if it's not nil, otherwise returns nil.

func ToStringPtr

func ToStringPtr(s string) *string

ToStringPtr returns a pointer to the string value.

func ToStringPtrIfNotEmpty

func ToStringPtrIfNotEmpty(s string) *string

ToStringPtrIfNotEmpty returns a pointer to the string value if it's not empty, otherwise returns nil.

func ToUint32Ptr

func ToUint32Ptr(v uint32) *uint32

ToUint32Ptr returns a pointer to the value.

func ToUint32PtrIfNotZero

func ToUint32PtrIfNotZero(v uint32) *uint32

ToUint32PtrIfNotZero returns a pointer to the uint32 value if it's not zero, otherwise returns nil.

func ToUint64Ptr

func ToUint64Ptr(v uint64) *uint64

ToUint64Ptr returns a pointer to the value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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