Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnceFunc ¶
func OnceFunc(f func()) func()
OnceFunc returns a function that invokes f only once. The returned function may be called concurrently.
If f panics, the returned function will panic with the same value on every call.
func OnceValue ¶
func OnceValue[T any](f func() T) func() T
OnceValue returns a function that invokes f only once and returns the value returned by f. The returned function may be called concurrently.
If f panics, the returned function will panic with the same value on every call.
func OnceValues ¶
func OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2)
OnceValues returns a function that invokes f only once and returns the values returned by f. The returned function may be called concurrently.
If f panics, the returned function will panic with the same value on every call.
Types ¶
This section is empty.