1
0
mirror of https://github.com/golang/go synced 2024-11-20 03:04:40 -07:00

cmd/go: Dedup package arguments before building.

Fixes #4104.

R=golang-dev, dave, minux.ma
CC=golang-dev
https://golang.org/cl/6639051
This commit is contained in:
Daniel Morsing 2012-10-17 17:23:47 +02:00
parent 73f11171b4
commit a2659aa6a1
2 changed files with 11 additions and 0 deletions

View File

@ -671,7 +671,12 @@ func packagesAndErrors(args []string) []*Package {
args = importPaths(args)
var pkgs []*Package
var stk importStack
var set = make(map[string]bool)
for _, arg := range args {
set[arg] = true
}
for arg := range set {
pkgs = append(pkgs, loadPackage(arg, &stk))
}

View File

@ -136,6 +136,12 @@ if GOPATH=:$(pwd)/testdata:. ./testgo build go-cmd-test; then
ok=false
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
echo PASS
else