Commit a2659aa6 authored by Daniel Morsing's avatar Daniel Morsing

cmd/go: Dedup package arguments before building.

Fixes #4104.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6639051
parent 73f11171
...@@ -671,7 +671,12 @@ func packagesAndErrors(args []string) []*Package { ...@@ -671,7 +671,12 @@ func packagesAndErrors(args []string) []*Package {
args = importPaths(args) args = importPaths(args)
var pkgs []*Package var pkgs []*Package
var stk importStack var stk importStack
var set = make(map[string]bool)
for _, arg := range args { for _, arg := range args {
set[arg] = true
}
for arg := range set {
pkgs = append(pkgs, loadPackage(arg, &stk)) pkgs = append(pkgs, loadPackage(arg, &stk))
} }
......
...@@ -136,6 +136,12 @@ if GOPATH=:$(pwd)/testdata:. ./testgo build go-cmd-test; then ...@@ -136,6 +136,12 @@ if GOPATH=:$(pwd)/testdata:. ./testgo build go-cmd-test; then
ok=false ok=false
fi fi
# issue 4104
if [ $(./testgo test fmt fmt fmt fmt fmt | wc -l) -ne 1 ] ; then
echo 'go test fmt fmt fmt fmt fmt tested the same package multiple times'
ok=false
fi
if $ok; then if $ok; then
echo PASS echo PASS
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment