pointer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package pointer provides a mechanism for creating a pointer from expressions whose address cannot be directly taken. For example, literal strings. &"literal" is not valid but pointer.Ptr("literal") will return the address of a string variable that contains "literal".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr

func Ptr[T any](o T) *T

Ptr returns a pointer to the given value.

func UnPtr

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

UnPtr returns either the value pointed to by p or the zero value of T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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