ptrs

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce added in v0.18.0

func Coalesce[T any](values ...*T) *T

Coalesce returns the first non-nil pointer in the list

func False added in v0.10.2

func False() *bool

False returns a pointer to false

func One added in v0.10.2

func One[T Number]() *T

One returns a pointer to one

func Ptr added in v0.10.1

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

Ptr returns a pointer to a value

func SetIfPresent

func SetIfPresent[T any](target *T, value *T)

SetIfPresent sets target to value if value is not nil

func True added in v0.10.2

func True() *bool

True returns a pointer to true

func Zero added in v0.10.2

func Zero[T Number]() *T

Zero returns a pointer to zero

Types

type Number added in v0.10.2

type Number interface {
	constraints.Integer | constraints.Float
}

Number is a constraint that permits any numerical type.

Jump to

Keyboard shortcuts

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