Discover Packages
github.com/crowdsecurity/go-cs-lib
ptr
package
Version:
v0.0.11
Opens a new window with list of versions in this module.
Published: May 7, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 13
Opens a new window with list of known importers.
Documentation
Documentation
¶
Empty returns an empty T type
Of returns a pointer to the input. In most cases, callers should just do &t. However, in some cases
Go cannot take a pointer. For example, `ptr.Of(f())`.
func OrDefault[T any ](t *T, def T) T
OrDefault returns *t if its non-nil, or else def.
func OrEmpty[T any ](t *T) T
OrEmpty returns *t if its non-nil, or else an empty T
TypeName returns the name of the type
Source Files
¶
Click to show internal directories.
Click to hide internal directories.