types

package
v1.2.58 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pointer

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

Pointer returns a pointer to the value passed in.

func PointerMap

func PointerMap[M ~map[K]V, N map[K]*V, K comparable, V any](src M) N

PointerMap converts a map of values into a map of pointers

func PointerSlice

func PointerSlice[S ~[]E, V []*E, E any](src S) V

PointerSlice converts a slice of values into a slice of pointers

func Value

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

Value returns the value of the pointer passed in or "" if the pointer is nil.

func ValueMap

func ValueMap[M ~map[K]*V, N map[K]V, K comparable, V any](src M) N

ValueMap converts a map of string pointers into a string map of values

func ValueSlice

func ValueSlice[S ~[]*E, V []E, E any](src S) V

ValueSlice converts a slice of pointers into a slice of values

Types

This section is empty.

Jump to

Keyboard shortcuts

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