(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func 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 | } |
nothing calls this directly
no test coverage detected