code: func GoMainDirs(packages []string, GoCmd string) ([]string, error) {
  	args := make([]string, 0, len(packages)+3)
  	args = append(args, "list", "-f", "{{.Name}}|{{.ImportPath}}")
  	args = append(args, packages...)
  
  	output, err := execGo(GoCmd, nil, "", args...)
  	if err != nil {
  		return nil, err
  	}
  
  	results := make([]string, 0, len(output))
  	for _, line := range strings.Split(output, "\n") {
  		if line == "" {
  			continue
  		}
  
  		parts := strings.SplitN(line, "|", 2)
  		if len(parts) != 2 {
  			log.Printf("Bad line reading packages: %s", line)
  			continue
  		}
  
  		if parts[0] == "main" {
  			results = append(results, parts[1])
  		}
  	}
  
  	return results, nil
  }
docs: // GoMainDirs returns the file paths to the packages that are "main"
  // packages, from the list of packages given. The list of packages can
  // include relative paths, the special "..." Go keyword, etc.