sync

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnceValue

func OnceValue[T any](f func() (T, error)) func() (T, error)

OnceValue is a wrapper around sync.Once that runs f only once and returns both a value (of type T) and an error.

func OnceValueCtx

func OnceValueCtx[T any](f func(ctx context.Context) (T, error)) func(context.Context) (T, error)

OnceValueCtx is similar to OnceValue, but allows passing a context to f.

Types

This section is empty.

Jump to

Keyboard shortcuts

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