pointer

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrDefault

func GetOrDefault[T any](ptr *T, defaultValue T) T

GetOrDefault returns the value of a pointer or a default value

func GetOrNilIfEmpty added in v2.2.1

func GetOrNilIfEmpty[T any](val []T) *[]T

func MakePtr

func MakePtr[T any](value T) *T

MakePtr returns a pointer to the given value

func SetOrNil

func SetOrNil[T comparable](val T, defaultValue T) *T

SetOrNil returns the address of the given value or nil if it equals defaultValue

Types

This section is empty.

Jump to

Keyboard shortcuts

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