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

ptr

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ptr contains some utility methods related to pointers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NilOrEmpty

func NilOrEmpty(s *string) bool

NilOrEmpty returns true if s is nil or the empty string.

func NilOrZero

func NilOrZero[T number](v *T) bool

NilOrZero returns true if v is nil or 0.

func NilToEmpty added in v0.7.2

func NilToEmpty(s *string) string

NilToEmpty coalesces a nil str to the empty string.

func Ref

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

Ref returns a reference to v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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