pointer

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 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 MakePtrOrNil added in v2.3.1

func MakePtrOrNil[T comparable](value T) *T

MakePtrOrNil returns a pointer only when value is not empty. Otherwise Atlas versioned API interprets a pointer to an empty value as not empty.

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