pointer

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

README

pointer

A util library for getting a pointer in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deref

func Deref[T any](x *T) T

Deref returns the value of a pointer.

func DerefMap

func DerefMap[K comparable, V any](x map[K]*V) map[K]V

DerefMap returns the value of a pointer for every element in a map.

func DerefSlice

func DerefSlice[T any](x []*T) []T

DerefSlice returns the value of a pointer for every element in a slice.

func ForMap

func ForMap[K comparable, V any](x map[K]V) map[K]*V

ForMap returns the pointer for every element in a map.

func ForSlice

func ForSlice[T any](x []T) []*T

ForSlice returns the pointer for every element in a slice.

func To

func To[T any](x T) *T

To returns a pointer to a value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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