Home | History | Annotate | Download | only in sync

Lines Matching refs:Once

11 // Once is an object that will perform exactly one action.
12 type Once struct {
18 // first time for this instance of Once. In other words, given
19 // var once Once
20 // if once.Do(f) is called multiple times, only the first call will invoke f,
22 // Once is required for each function to execute.
24 // Do is intended for initialization that must be run exactly once. Since f
27 // config.once.Do(func() { config.init(filename) })
35 func (o *Once) Do(f func()) {