pointer

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStructPtr

func IsStructPtr(x any) bool

IsStructPtr checks if the given interface is a pointer to a struct.

func Ptr

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

Ptr returns a pointer to its argument. For example, Ptr[int](100) returns *int pointing to 100.

func Value

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

Value returns the value that the pointer p points to. If p is nil, it returns the zero value of the type T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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