Documentation
¶
Overview ¶
Package ptr contains some utility methods related to pointers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromNullString ¶ added in v2.37.0
func FromNullString(v sql.NullString) *string
FromNullString returns a pointer to the string when it is valid and nil otherwise.
func NilOrEmpty ¶
NilOrEmpty returns true if s is nil or the empty string.
func NilToDefault ¶
func NilToDefault[T any](s *T, def T) T
NilToDefault coalesces a nil value to the provided default value.
func NilToEmpty ¶
func NilToEmpty[T any](s *T) T
NilToEmpty coalesces a nil value to the empty value.
Types ¶
This section is empty.