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

ptr

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func To

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

To returns a pointer to a copy of the given value. One use case of this is to circumvent UnadressableOperand errors.

func Value

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

Value returns the value referenced by p, if p is non-nil, else it returns the default value def.

Types

This section is empty.

Jump to

Keyboard shortcuts

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