ptr

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 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 NilToDefault added in v0.23.1

func NilToDefault[T any](s *T, def T) T

NilToDefault coalesces a nil value to the provided default value.

func NilToEmpty added in v0.7.2

func NilToEmpty[T any](s *T) T

NilToEmpty coalesces a nil value to the empty value.

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy