ptrutil

package
v2.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package ptrutil provides functions for working with pointers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dereference

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

Dereference dereferences a pointer, returning zero if the pointer is nil.

func Ptr

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

Ptr returns the pointer to the given value. Useful for when you want to get the pointer of a magic value: Ptr("hello").

Types

This section is empty.

Jump to

Keyboard shortcuts

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