pointer

package module
v2.0.0-...-3c338e2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 1 Imported by: 0

README

pointer

Pointer package provides functions for value-to-pointer/pointer-to-value conversions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce

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

Coalesce returns the first non-nil value in a list (or fallback value when all nils).

func New

func New[T any](val T) *T

New returns a new pointer to provided value.

func Unpoint

func Unpoint(v interface{}) interface{}

Unpoint returns actual value of the pointers

func Value

func Value[T any](ptr *T) (T, bool)

Value returns pointer value and true if not nil or zero value and false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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