pointer

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPointer

func ExtractPointer(value any) any

ExtractPointer returns the underlying value by the given interface type

func Of

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

Of returns a pointer to the value `v`.

func UnwarpOr

func UnwarpOr[T any](p *T, fallback T) T

UnwarpOr returns the value from the pointer or fallback if the pointer is nil.

func UnwarpOrDefault

func UnwarpOrDefault[T any](p *T) T

UnwarpOrDefault returns the value from the pointer or the default value if the pointer is nil.

func Unwrap

func Unwrap[T any](p *T) T

Unwrap returns the value from the pointer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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