Lines Matching refs:Once

26 	a := once.Once(key, func() interface{} { return "a" }).(string)
27 b := once.Once(key, func() interface{} { return "b" }).(string)
30 t.Errorf(`first call to Once should return "a": %q`, a)
34 t.Errorf(`second call to Once with the same key should return "a": %q`, b)
44 …go once.Once(key, func() interface{} { close(ch); time.Sleep(100 * time.Millisecond); return "foo"…
46 a := once.Once(key, func() interface{} { return "bar" }).(string)
57 a := once.Once(key, func() interface{} { return "a" }).(string)
61 t.Errorf(`first call to Once should return "a": %q`, a)
90 …go once.Once(key, func() interface{} { close(ch); time.Sleep(100 * time.Millisecond); return "foo"…
136 a := once.Once(key1, func() interface{} { return "a" }).(string)
137 b := once.Once(key2, func() interface{} { return "b" }).(string)
140 t.Errorf(`first call to Once should return "a": %q`, a)
144 t.Errorf(`second call to Once with the NewOnceKey from same string should return "b": %q`, b)
156 a := once.Once(key1, func() interface{} { return "a" }).(string)
157 b := once.Once(key2, func() interface{} { return "b" }).(string)
160 t.Errorf(`first call to Once should return "a": %q`, a)
164 t.Errorf(`second call to Once with the NewCustomOnceKey from equal key should return "a": %q`, b)
173 …a := once.Once(key1, func() interface{} { return once.Once(key2, func() interface{} { return "a" }…
175 t.Errorf(`reentrant Once should return "a": %q`, a)
193 a = once.Once(key, func() interface{} {
209 b := once.Once(key, func() interface{} {