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:
parent
73f11171b4
commit
a2659aa6a1
@ -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))
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user