pointers

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

SOURCE: https://sourcegraph.com/r/github.com/sourcegraph/sourcegraph-public-snapshot@6d5493b/-/blob/lib/pointers/ptr.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deref

func Deref[T any](v *T, defaultValue T) T

Deref safely dereferences a pointer. If pointer is nil, returns zero value, otherwise returns dereferenced value.

func NonZeroPtr

func NonZeroPtr[T comparable](val T) *T

NonZeroPtr returns nil for zero value, otherwise pointer to value

func Ptr

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

Ptr returns a pointer to any value. Useful in tests or when pointer without a variable is needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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