Ptr returns a pointer to the given value.
(v T)
| 2 | |
| 3 | // Ptr returns a pointer to the given value. |
| 4 | func Ptr[T any](v T) *T { |
| 5 | return &v |
| 6 | } |
| 7 | |
| 8 | // ValOrDefault returns the value of the given pointer as long as it's non-nil, |
| 9 | // and the specified default value otherwise. |
no outgoing calls