Go · Class
sync.Once
sync.Once runs one function exactly once for a given Once value. Other callers wait for that function to finish, and later calls do nothing.
Last updated
Syntax
func (o *Once) Do(f func())In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
sync.Mutexsync/atomic.BoolGo memory model