build: remove workaround for ./... vendor matching

This workaround was necessary for Go 1.8. The Go 1.9 release changed
the expansion rules to exclude vendored packages.
This commit is contained in:
Felix Lange 2019-09-11 13:28:10 +02:00
parent b6e673152a
commit de9ba1b4a1
2 changed files with 0 additions and 28 deletions

View file

@ -214,7 +214,6 @@ func doInstall(cmdline []string) {
if flag.NArg() > 0 { if flag.NArg() > 0 {
packages = flag.Args() packages = flag.Args()
} }
packages = build.ExpandPackagesNoVendor(packages)
if *arch == "" || *arch == runtime.GOARCH { if *arch == "" || *arch == runtime.GOARCH {
goinstall := goTool("install", buildFlags(env)...) goinstall := goTool("install", buildFlags(env)...)
@ -311,7 +310,6 @@ func doTest(cmdline []string) {
if len(flag.CommandLine.Args()) > 0 { if len(flag.CommandLine.Args()) > 0 {
packages = flag.CommandLine.Args() packages = flag.CommandLine.Args()
} }
packages = build.ExpandPackagesNoVendor(packages)
// Run the actual tests. // Run the actual tests.
// Test a single package at a time. CI builders are slow // Test a single package at a time. CI builders are slow

View file

@ -153,32 +153,6 @@ func GoTool(tool string, args ...string) *exec.Cmd {
return exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), args...) return exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), args...)
} }
// ExpandPackagesNoVendor expands a cmd/go import path pattern, skipping
// vendored packages.
func ExpandPackagesNoVendor(patterns []string) []string {
expand := false
for _, pkg := range patterns {
if strings.Contains(pkg, "...") {
expand = true
}
}
if expand {
cmd := GoTool("list", patterns...)
out, err := cmd.CombinedOutput()
if err != nil {
log.Fatalf("package listing failed: %v\n%s", err, string(out))
}
var packages []string
for _, line := range strings.Split(string(out), "\n") {
if !strings.Contains(line, "/vendor/") {
packages = append(packages, strings.TrimSpace(line))
}
}
return packages
}
return patterns
}
// UploadSFTP uploads files to a remote host using the sftp command line tool. // UploadSFTP uploads files to a remote host using the sftp command line tool.
// The destination host may be specified either as [user@]host[: or as a URI in // The destination host may be specified either as [user@]host[: or as a URI in
// the form sftp://[user@]host[:port]. // the form sftp://[user@]host[:port].