Documentation ¶ Index ¶ type Lazy func New[T any](getter func() T) Lazy[T] Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Lazy ¶ type Lazy[T any] interface { // Get returns the value, evaluate it if necessary. Get() T // Evaluated returns whether the value has been evaluated or not. Evaluated() bool } Lazy defers the evaluation of getter until it's accessed the first access. func New ¶ func New[T any](getter func() T) Lazy[T] New returns a new lazily evaluated value. The getter is executed only when it's accessed the first access. Source Files ¶ View all Source files lazy.go Click to show internal directories. Click to hide internal directories.