lazy

package
v0.3.4-0...-1eafea6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package lazy provides one-shot lazy initialization of a value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lazy

type Lazy[T any] struct {
	// contains filtered or unexported fields
}

Lazy provides one-shot lazy initialization of a value T.

func New

func New[T any](init func() (T, error)) *Lazy[T]

New creates a new Lazy which when initialized for the first time calls the initialization function provided.

func (*Lazy[T]) Get

func (l *Lazy[T]) Get() (T, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL