Go generic lazy go get -u github.com/go-saas/lazy import ( "context" "github.com/go-saas/lazy" ) type A struct { } lazyA := lazy.New[*A](func(ctx context.Context) (*A, error){ return &A{} }) a,_ := lazyA.Value(context.Background())