Help us shape the future of Go! Take the 2026 Go Developer Survey

ptr

package
v1.104.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 0 Imported by: 37

Documentation

Overview

Package ptr contains the ptr.To function.

Deprecated: Use Go 1.26's new(value) expression instead. See https://go.dev/doc/go1.26#language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func To deprecated

func To[T any](v T) *T

To returns a pointer to a shallow copy of v.

Deprecated: Use Go 1.26's new(value) expression instead. For example, ptr.To(42) can be written as new(42). See https://go.dev/doc/go1.26#language.

Types

This section is empty.

Jump to

Keyboard shortcuts

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