ptr

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringFromPointer added in v0.1.14

func StringFromPointer(s *string) string

StringFromPointer returns the string value of a pointer to a string or an empty string if the pointer is nil.

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