ptr

package
v0.0.0-...-c1fbc2c Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is[T any]() bool

Is checks if the generic parameter is a pointer type. Returns true if T is a pointer, false otherwise.

func Of

func Of[T any](val T) *T

Of allocates a new instance of the given type, copies the value into it, and returns it. This can be used as a utility to make pointers to static values. For example: Of[uint](123) returns a uint pointer containing the value 123.

Types

This section is empty.

Jump to

Keyboard shortcuts

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