Lines Matching refs:a
26 a := once.Once(key, func() interface{} { return "a" }).(string)
29 if a != "a" {
30 t.Errorf(`first call to Once should return "a": %q`, a)
46 a := once.Once(key, func() interface{} { return "bar" }).(string)
48 if a != "foo" {
49 t.Errorf("expect %q, got %q", "foo", a)
57 a := once.Once(key, func() interface{} { return "a" }).(string)
60 if a != "a" {
61 t.Errorf(`first call to Once should return "a": %q`, a)
92 a := once.Get(key).(string)
94 if a != "foo" {
95 t.Errorf("expect %q, got %q", "foo", a)
103 a := once.OnceStringSlice(key, func() []string { return []string{"a"} })
106 if a[0] != "a" {
107 t.Errorf(`first call to OnceStringSlice should return ["a"]: %q`, a)
119 …a, b := once.Once2StringSlice(key, func() ([]string, []string) { return []string{"a"}, []string{"b…
122 if a[0] != "a" || b[0] != "b" {
123 t.Errorf(`first call to Once2StringSlice should return ["a"], ["b"]: %q, %q`, a, b)
136 a := once.Once(key1, func() interface{} { return "a" }).(string)
139 if a != "a" {
140 t.Errorf(`first call to Once should return "a": %q`, a)
156 a := once.Once(key1, func() interface{} { return "a" }).(string)
159 if a != "a" {
160 t.Errorf(`first call to Once should return "a": %q`, a)
173 …a := once.Once(key1, func() interface{} { return once.Once(key2, func() interface{} { return "a" }…
174 if a != "a" {
175 t.Errorf(`reentrant Once should return "a": %q`, a)
186 var a interface{}
193 a = once.Once(key, func() interface{} {
204 if a != nil {
205 t.Errorf(`expected a to be nil, got %#v`, a)