Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LazyInit ¶
type LazyInit[T any] interface { // Get retrieves the lazily initialized value. Get(args ...any) T // Reset clears the initialized value. Reset() // IsInitialized checks if the value has been initialized. IsInitialized() bool }
LazyInit is an interface for lazily initializing a value of type T.
func NewFromFunc ¶
NewFromFunc creates a new LazyInit instance with a no-argument initialization function.
func NewFromFuncWithArgs ¶
NewFromFuncWithArgs creates a new LazyInit instance with an initialization function accepting arguments.
Click to show internal directories.
Click to hide internal directories.