Skip to content
livebudPublic

About

Utilities for calling functions only once.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Once

Go Reference

Utilities for calling functions only once. Safe for concurrent use. Supports generics.

Install

go get github.com/livebud/once

Usage

count := 0
fn := once.Func(func() (int, error) {
  count++
  return count, nil
})
res, err := fn()
// 1
res, err = fn()
// 1

Contributors

License

MIT

About

Utilities for calling functions only once.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages