Documentation ¶
Overview ¶
Package ptr contains functions to create references from constant values, typically for representing optional values.
Index ¶
- func Bool(b bool) *bool
- func BoolEqual(p1, p2 *bool) bool
- func Duration(n time.Duration) *time.Duration
- func DurationEqual(p1, p2 *time.Duration) bool
- func Float64(n float64) *float64
- func Float64Equal(p1, p2 *float64) bool
- func Int(n int) *int
- func Int32(n int32) *int32
- func Int32Equal(p1, p2 *int32) bool
- func Int64(n int64) *int64
- func Int64Equal(p1, p2 *int64) bool
- func IntEqual(p1, p2 *int) bool
- func String(s string) *string
- func StringEqual(p1, p2 *string) bool
- func Time(n time.Time) *time.Time
- func TimeEqual(p1, p2 *time.Time) bool
- func ToString(s *string) string
- func ToUInt(n *uint) uint
- func UInt(n uint) *uint
- func Unwrap[T any](v *T) T
- func Wrap[T any](v T) *T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationEqual ¶
DurationEqual compares two Duration pointers for equality
func Float64Equal ¶
Float64Equal compares two float64 pointers for equality.
func Int32Equal ¶
Int32Equal compares two int32 pointers for equality.
func Int64Equal ¶
Int64Equal compares two int64 pointers for equality.
func StringEqual ¶
StringEqual compares two string pointers for equality.
func ToString ¶
ToString is a convenience method for dereferencing a string pointer to a string. "" is returned if the pointer is nil.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.