MCPcopy Create free account
hub / github.com/SKeyerror/Psyduck / TestOnceSingleton

Function TestOnceSingleton

go-concurrency/mutex/once_test.go:35–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestOnceSingleton(t *testing.T) {
36 var wg sync.WaitGroup
37 wg.Add(10)
38
39 for i := 0; i < 10; i++ {
40 go func() {
41 defer wg.Done()
42 config := GetOtherConfig()
43 fmt.Printf("other config address : %p \n", config)
44 }()
45 }
46
47 wg.Wait()
48
49 fmt.Printf("other config address : %p", GetOtherConfig())
50}

Callers

nothing calls this directly

Calls 1

GetOtherConfigFunction · 0.85

Tested by

no test coverage detected