generic

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 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[E any](e *E, defaultValue E) E

Deref returns the value e points to if it's non-nil. Otherwise, it returns the defaultValue.

func DerefFunc

func DerefFunc[E any](e *E, defaultFunc func() E) E

DerefFunc returns the value e points to if it's non-nil. Otherwise, it returns the result of calling defaultFunc.

func Identity

func Identity[E any](e E) E

Identity is a function that returns its given parameters.

func Pointer

func Pointer[E any](e E) *E

Pointer returns a pointer for the given value.

func Zero

func Zero[E any]() E

Zero returns the zero value for the given type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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