ptr

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package ptr contains the Ptr function

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr

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

Ptr takes an argument and returns a pointer to it this is useful when instantiating structs whose fields are pointers to basic types

func ValueOrZero added in v0.2.0

func ValueOrZero[T any](ptr *T) T

ValueOrZero returns the value of a pointer or the zero value if nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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