ptr

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deref

func Deref[T any](p *T, def T) T

Deref dereferences the pointer; if nil, returns def.

func OrDefault

func OrDefault[T comparable](v, def T) T

OrDefault returns def when v equals the type's zero value; otherwise returns v. Note: works only for comparable types.

func Ptr

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

Ptr returns a pointer to the given value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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