Documentation
¶
Index ¶
- func Duplicate[T any, PT *T](p PT) PT
- func EqualValue[T comparable, PT *T](p1 PT, p2 PT) bool
- func EqualValueFunc[T any, PT *T](p1 PT, p2 PT, equal func(PT, PT) bool) bool
- func GetValueOrDefault[T any, PT *T](p PT, defaultValue T) T
- func Make[T any, PT *T](pp *PT, val T)
- func NotTrue[T ~bool, PT *T](p PT) bool
- func SetValue[T any, PT *T](pp *PT, val T)
- func SetValueFrom[T any, PT *T](pp *PT, pVal PT)
- func TrueValue[T ~bool, PT *T](p PT) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Duplicate ¶
func Duplicate[T any, PT *T](p PT) PT
Creates a new pointer from the given pointer, pointing to the same value as the original pointer. Returns nil if the input pointer is nil.
func EqualValue ¶
func EqualValue[T comparable, PT *T](p1 PT, p2 PT) bool
Checks if the values pointed to by two pointers are equal. If either pointer is nil, returns true if both are nil.
func EqualValueFunc ¶
Checks if the values pointed to by two pointers are equal using a custom equality function. If either pointer is nil, returns true if both are nil. The function will be called only if both pointers are non-nil.
func GetValueOrDefault ¶
func GetValueOrDefault[T any, PT *T](p PT, defaultValue T) T
func Make ¶
func Make[T any, PT *T](pp *PT, val T)
Sets the value of the pointer to the given value, allocating new memory if the pointer is nil.
func SetValue ¶
func SetValue[T any, PT *T](pp *PT, val T)
Sets the value pointed to by a pointer to the given value, allocating new memory if the pointer is nil.
func SetValueFrom ¶
func SetValueFrom[T any, PT *T](pp *PT, pVal PT)
Sets the value pointed to by a pointer to the value pointed to by another pointer, allocating new memory if the pointer is nil.
Types ¶
This section is empty.