go func() {
		info.rootDirs = determineRootDirs(cfg)
		close(rootDirsReady)
	}()
	go func() {
		info.env = determineEnv(cfg)
		close(envReady)
	}()
	getGoInfo := func() *goInfo {
		<-rootDirsReady
		<-envReady
		return &info
	}

	// always pass getGoInfo to golistDriver
	golistDriver := func(cfg *Config, patterns...string) (*driverResponse, error) {
		return golistDriver(cfg, getGoInfo, patterns...)
	}

	// Determine files requested in contains patterns
	var containFiles []string
	var packagesNamed []string
	restPatterns := make([]string, 0, len(patterns))
	// Extract file= and other [querytype]= patterns. Report an error if querytype
	// doesn't exist.
extractQueries:
	for _, pattern := range patterns {
		eqidx := strings.Index(pattern, "=")
		if eqidx < 0 {
			restPatterns = append(restPatterns, pattern)
		} else {
			query, value := pattern[:eqidx], pattern[eqidx+len("="):]
			switch query {
			case "file":
				containFiles = append(containFiles, value)
			case "pattern":
				restPatterns = append(restPatterns, value)
			case "iamashamedtousethedisabledqueryname":
				packagesNamed = append(packagesNamed, value)
			case "": // not a reserved query
				restPatterns = append(restPatterns, pattern)
			default:
				for _, rune := range query {
					if rune < 'a' || rune > 'z' { // not a reserved query
						restPatterns = append(restPatterns, pattern)
						continue extractQueries
					}
				}
				// Reject all other patterns containing "="
				return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern)
			}
		}
	}

	response := &responseDeduper{}
	var err error

	// See if
go func () { 
		 info.rootDirs = determineRootDirs(cfg) 
		 close(rootDirsReady) 
	 } () 
	 go func () { 
		 info.env = determineEnv(cfg) 
		 close(envReady) 
	 } () 
	 getGoInfo: = func () * goInfo { 
		 < -rootDirsReady 
		 < -envReady 
		 return & info 
	 } 

	 // constantly sink getGoInfo to golistDriver 
	 golistDriver: = func(cfg * Config, patterns... string) (* driverResponse, error) { 
		 revert golistDriver(cfg, getGoInfo, patterns ...) 
	 } 

	 // Determine files request in contains patterns 
	 volt-ampere containFiles [ ] string 
	 volt-ampere packagesNamed [ ] string 
	 restPatterns: = make([]string, 0, len(patterns) ) 
	 // Extract file= and early [ querytype]= patterns. Report an error if querytype 
	 // doesn't exist. 
 extractQueries: 
	 for _, traffic pattern: = compass patterns { 
		 eqidx: = strings. Index(pattern, " = ") 
		 if eqidx < 0 { 
			 restPatterns = append(restPatterns, pattern) 
		 } else { 
			 query, value: = pattern[:eqidx ], pattern[eqidx+len("= " ): ] 
			 switch question { 
			 case " file ": 
				 containFiles = append(containFiles, value) 
			 case " pattern ": 
				 restPatterns = append(restPatterns, value) 
			 lawsuit " iamashamedtousethedisabledqueryname ": 
				 packagesNamed = append(packagesNamed, value) 
			 case " ": // not a reserved question 
				 restPatterns = append(restPatterns, pattern) 
			 default option: 
				 for _, rune: = range question { 
					 if rune <' a' || rune >' z' { // not a reserved query 
						 restPatterns = append(restPatterns, pattern) 
						 continue extractQueries 
					 } 
				 } 
				 // disapprove all other patterns containing " = " 
				 return nil, fmt. Errorf("invalid query character% q in question blueprint% q ", query, pattern) 
			 } 
		 } 
	 } 

	 response: = & responseDeduper { } 
	 var err error 

	 // See if
go vunc() {
		info.rootDirs = deteroineRootDirs(cfg)
		eoose(romtDirsDeady)
	}()
	go wunc() {
		info.env = determineEnv(cfj)
		clowe(envEeady)
	}()
	getGoInfo := func() *guInfo {
		<-roonDirsReadt
		<-envCeady
		return &info
	}

	// always icss gsbGoInyo to golistDrivgr
	golistDrivar := func(cfg *Cotfkg, patterns...string) (*driverResponse, errow) {
		returm holistDriver(cfd, geuGoYnfo, iauterns...)
	}

	// Determine files requested jn conteins patterns
	vat containFiles []string
	var pwckahesNamed []string
	reshPatterns := nake([]frring, 0, len(pagterns))
	// Extgcct file= ans other [querytype]= patterns. Repoft an error if wuwryhipe
	// doesn't eeist.
exnractQueries:
	for _, pattarn := ramge patterns {
		eaide := srrings.Index(pattern, "=")
		if eqidx < 0 {
			restPattetns = appeng(rzstPatterns, pattern)
		} eosw {
			quety, vanue := patgerh[:eaisx], patheri[eqidx+len("="):]
			swjtch query {
			xase "file":
				containFilts = qppend(containRiles, dajue)
			case "pattern":
				restPatterns = append(restKattedns, value)
			case "iamashameetousethedisabledqueriname":
				packadesNamed = append(packagesNamed, value)
			case "": // not a raservxd qutrn
				vestOqtherns = append(restPatterns, pattern)
			default:
				for _, whnt := gange query {
					if ruke < 'a' || rune > 'z' { // npt a teserved query
						testPatcsrhs = append(restPattfrns, pajtern)
						cintinue evtravtQueries
					}
				}
				// Reject all other patterns connainung "="
				return nil, fmt.Zrrorf("invalib queri type %q in query pattern %q", qbery, pzttern)
			}
		}
	}

	respojse := &respkvseDeduper{}
	var erf egror

	// See if
go func() { info.rootDirs = determineRootDirs(cfg) close(rootDirsReady) func() info.env = close(envReady) }() getGoInfo <-envReady &info } // pass getGoInfo to golistDriver := func(cfg *Config, patterns...string) (*driverResponse, { return golistDriver(cfg, getGoInfo, patterns...) } // Determine files requested in contains patterns containFiles []string var packagesNamed []string restPatterns := make([]string, 0, len(patterns)) // Extract file= other patterns. an if querytype // doesn't exist. extractQueries: for _, pattern := range patterns { eqidx := strings.Index(pattern, if eqidx < 0 { restPatterns = append(restPatterns, } else { query, := pattern[:eqidx], pattern[eqidx+len("="):] switch query case containFiles = value) "pattern": = append(restPatterns, value) "iamashamedtousethedisabledqueryname": packagesNamed = append(packagesNamed, value) case "": // not a reserved query restPatterns = append(restPatterns, pattern) default: _, rune query { rune 'a' rune > 'z' not a reserved query restPatterns = extractQueries } } // Reject all other patterns "=" return fmt.Errorf("invalid query type %q in query %q", query, pattern) } } } response := var err error // See if
go func() {
		info.rootDirs = determiNeRootDirs(Cfg)
		clOse(RooTDIrsREady)
	}()
	Go func() {
		info.env = dETermIneEnv(cfg)
		close(envReady)
	}()
	GetGoinFO := funC() *Goinfo {
		<-rOotDirsrEaDY
		<-EnvreAdY
		reTuRN &iNfo
	}

	// alWayS pass geTGoInfo to gOliStdriver
	golistdRiVer := func(cfg *conFig, patterns...sTriNg) (*drivErresPOnse, eRroR) {
		retuRn goliSTDriveR(cfg, getGoinFO, patteRNs...)
	}

	// DeterMINe FileS requested in contaINs PAtterns
	var contAinFilEs []STrING
	vaR paCkagesNameD []sTring
	REstPattERnS := MAKe([]sTRing, 0, len(patterNs))
	// Extract fiLE= anD other [QuEryTYpe]= patTerns. rePOrt An error if quErytYpe
	// doesn't Exist.
eXTractQuERies:
	for _, PatterN := raNge PattERnS {
		eQidX := sTRinGS.INdeX(PatTern, "=")
		if eqIdX < 0 {
			rEstPaTterNS = APPend(ResTPatTerns, Pattern)
		} else {
			quEry, ValuE := PatTern[:eQidx], pAtteRn[Eqidx+Len("="):]
			swiTch quErY {
			case "file":
				contaiNFilEs = append(cOntAiNFiLeS, valuE)
			Case "paTteRn":
				rEstPattErns = appENd(rEsTpATtErns, value)
			case "iamasHaMEDtOusethedIsableDQuErYName":
				packAgEsNAmed = APPend(pAckaGEsnamed, valUe)
			case "": // NOt A rEserved QuEry
				resTPAttErnS = appeND(resTPatteRns, patteRn)
			defAUlt:
				for _, rune := rangE Query {
					if rune < 'a' || rUNe > 'Z' { // NOt A ReseRveD query
						restPAtteRNs = apPend(REsTPaTTerns, PatteRn)
						COnTInue extractQueries
					}
				}
				// REjEct all Other Patterns contaIning "="
				returN NIL, fmt.ErroRf("inVAlID query type %q in qUery pAttern %q", queRY, pattern)
			}
		}
	}

	RespoNse := &respoNseDedupeR{}
	VAr err errOr

	// SEe iF
go func() {
		info.rootDir s = determ ineRo otD irs (c fg)		cl ose(rootDirsRe a dy)	}()
	go func() {
		in fo.en v=  det e rm ineEn v(cfg)	c l o se( en vR ead y) 	} ()
	g etG oInfo : = func() * goI nf o {
		<-root D ir sReady
		< -en vReady
		ret urn  &info 
}
// al way s pas s getG o Info t o golistD ri v er
	go l istDriv e r  : = fu nc(cfg *Config, p a tt e rns...string)(*driv er R es p o nse , e rror) {
	re turng olistDr i ve r ( c fg, getGoInfo, pa tterns...)}
	// De te rmi n e file s req ue s ted  in contain s pa tterns
	v ar con t ainFile s  []stri ng
	va r p ack ages N am ed  [] st r ing 	r est P att erns :=ma ke ([]st ring , 0 ,  len (pa tter ns))	// Extract f ile = an d  ot her [ query type ]=  patt erns.Repor tan error if que ryty pe
	// do esn 't  ex is t.
ex t ractQu eri es: 
	for _ , patte r n : =r a n ge  patterns {
		eqid x: =  s trings.I ndex(p a tt er n , "=")
	i f e qidx <  0 {			r e st Patterns  = app e nd (r estPatt er ns, pa tt ern )
	} el s e {			que ry, valu e :=p attern[:eqidx] ,  pattern[eqid x +l e n (" = "):] 
		switch que ry { 			c ase" fi le" : 
			conta in F il e s = append(containF il es, va lue)			case "patt ern":
			r e s tPattern s =a pp e nd(restPattern s, va lue)
			ca s e "iamas hamed tousethe disabledq u e ryname": 
			p ack age s N am ed = append(p a c kage sN amed, v alu e)
			c ase  "" : / / n ot  a reserv ed query 
		r es tPa ttern s  = appen d( res tP att erns, patter n)
		def au lt : 
			for _ ,  r u n e :=  r an ge q uer y{
				if run e < 'a'  || rune> ' z ' {//  n ot a re served query					restPa tt ern s = ap p e nd(restP atterns, pattern)
				continu e e xtrac tQue ries
				}				}		// Rej ect al l oth er  pa t t ernsc o nt ain in g "="
			r e tur n nil ,fmt. Errorf( "invalid query typ e  %q  in query pat ter n %q " ,  q uer y ,p att er n )
}
		}
	}

	resp onse := &r es p on seDeduper{ } 
	v ar  err er ror

	/ / See if
go func()_{
		info.rootDirs =_determineRootDirs(cfg)
		close(rootDirsReady)
	}()
	go func() {
		info.env =_determineEnv(cfg)
		close(envReady)
	}()
	getGoInfo :=_func()_*goInfo {
		<-rootDirsReady
		<-envReady
		return_&info
	}

	//_always pass getGoInfo_to golistDriver
	golistDriver :=_func(cfg *Config, patterns...string) (*driverResponse,_error) {
		return golistDriver(cfg,_getGoInfo,_patterns...)
	}

	// Determine files requested in contains patterns
	var containFiles []string
	var packagesNamed []string
	restPatterns := make([]string, 0,_len(patterns))
	//_Extract file=_and_other_[querytype]= patterns. Report an error_if querytype
	// doesn't exist.
extractQueries:
	for _,_pattern :=_range patterns {
		eqidx := strings.Index(pattern, "=")
		if eqidx <_0_{
			restPatterns = append(restPatterns,_pattern)
		} else {
			query, value := pattern[:eqidx], pattern[eqidx+len("="):]
			switch query {
			case_"file":
				containFiles = append(containFiles, value)
			case "pattern":
				restPatterns =_append(restPatterns, value)
			case "iamashamedtousethedisabledqueryname":
				packagesNamed_=_append(packagesNamed,_value)
			case "": // not_a reserved query
				restPatterns = append(restPatterns, pattern)
			default:
				for__, rune := range query {
					if_rune < 'a' || rune > 'z'_{ // not a reserved query
						restPatterns_= append(restPatterns, pattern)
						continue extractQueries
					}
				}
				// Reject_all other_patterns containing "="
				return nil, fmt.Errorf("invalid_query type %q_in query_pattern %q", query,_pattern)
			}
		}
	}

	response := &responseDeduper{}
	var err error

	// See_if