// parallelize generates tests for the given source files concurrently.

parallelize generates tests for the given source files concurrently.
// parallelize generates tests for the given source files concurrently .
func parallelize(srcFiles, files []models.Path, opt *Options) ([]*GeneratedTest, error) {
	var wg sync.WaitGroup
	rs := make(chan *result, len(srcFiles))
	for _, src := range srcFiles {
		wg.Add(1)
		go func(src models.Path) {
			defer wg.Done()
			r := &result{}
			r.gt, r.err = generateTest(src, files, opt)
			rs <- r
		}(src)
	}
	go func() {
		wg.Wait()
		close(rs)
	}()
	return readResults(rs)
}
func parallelize ( srcFiles , files [ ] models . Path , opt * Options ) ( [ ] * GeneratedTest , error ) { var wg sync . WaitGroup rs := make ( chan * result , len ( srcFiles ) ) for _ , src := range srcFiles { wg . Add ( 1 ) go func ( src models . Path ) { defer wg . Done ( ) r := & result { } r . gt , r . err = generateTest ( src , files , opt ) rs <- r } ( src ) } go func ( ) { wg . Wait ( ) close ( rs ) } ( ) return readResults ( rs ) }
parallelize generates tests for the given source files concurrently.
parallelize generates tests for the given source files concurrently .
// Worker
 // Closer.
