Lines Matching refs:once
28 func (once *OncePer) maybeWaitFor(key OnceKey, value interface{}) interface{} {
33 value, _ = once.values.Load(key)
45 func (once *OncePer) Once(key OnceKey, value func() interface{}) interface{} {
47 if v, ok := once.values.Load(key); ok {
48 return once.maybeWaitFor(key, v)
53 if v, loaded := once.values.LoadOrStore(key, waiter); loaded {
55 return once.maybeWaitFor(key, v)
62 once.values.Store(key, v)
73 func (once *OncePer) Get(key OnceKey) interface{} {
74 v, ok := once.values.Load(key)
79 return once.maybeWaitFor(key, v)
83 func (once *OncePer) OnceStringSlice(key OnceKey, value func() []string) []string {
84 return once.Once(key, func() interface{} { return value() }).([]string)
88 func (once *OncePer) Once2StringSlice(key OnceKey, value func() ([]string, []string)) ([]string, []…
90 s := once.Once(key, func() interface{} {
99 func (once *OncePer) OncePath(key OnceKey, value func() Path) Path {
100 return once.Once(key, func() interface{} { return value() }).(Path)
104 func (once *OncePer) OnceSourcePath(key OnceKey, value func() SourcePath) SourcePath {
105 return once.Once(key, func() interface{} { return value() }).(SourcePath)