Documentation
¶
Overview ¶
Package ptr provides generic and concrete helpers for working with pointers.
The generic functions To, From, and FromOr cover any type. Concrete helpers like String, Int, and Bool are provided for the most common stdlib types. Conversion helpers IntToStr and BoolToYesNo turn pointer values into human-readable strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolToYesNo ¶
BoolToYesNo converts a *bool to "Yes" or "No", returning "" when nil.
func From ¶
func From[T any](p *T) T
From dereferences p, returning the zero value of T when p is nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.