github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/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  }