github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/pkg/random/random_test.go (about) 1 package random 2 3 import ( 4 "math/rand" 5 "sync" 6 "testing" 7 ) 8 9 // for go test -v -race 10 func TestConcurrency(t *testing.T) { 11 rnd := rand.New(NewSource()) 12 var wg sync.WaitGroup 13 14 for i := 0; i < 10; i++ { 15 wg.Add(1) 16 go func() { 17 rnd.Int63() 18 wg.Done() 19 }() 20 } 21 wg.Wait() 22 }