sync.Once exports the
Do(f func()) method that allows a single execution of a function under many concurrent requests. If I create a type of my own with an exported method:
Do(f func() interface) interface which does exactly the same thing but additionally returns a value, then what is a good name for such a struct? I thought that
Once is a good struct name since
helpers.Once can be recognized different from
sync.Once by the package name. But I received pushback on my code saying that similar names can cause confusion.
What are your thoughts about this?