]> Cypherpunks repositories - gostls13.git/commit
cmd/go: print each import error only once
authorHaraldNordgren <haraldnordgren@gmail.com>
Sat, 6 Jan 2018 20:30:42 +0000 (21:30 +0100)
committerIan Lance Taylor <iant@golang.org>
Tue, 27 Mar 2018 14:07:14 +0000 (14:07 +0000)
commita42ea51ae94af2005970a480ddc8ee257874908c
treee510c167c2f835fa9d8ede76d9e660d5bd18805b
parentea59ebd3387ab93b826606ea90a4149dad7b4e50
cmd/go: print each import error only once

This change prevents import errors from being printed multiple times.
Creating a bare-bones package 'p' with only one file importing itself
and running 'go build p', the current implementation gives this error
message:

can't load package: import cycle not allowed
package p
imports p
import cycle not allowed
package p
imports p

With this change we will show the message only once.

Updates #23295

Change-Id: I653b34c1c06c279f3df514f12ec0b89745a7e64a
Reviewed-on: https://go-review.googlesource.com/86535
Reviewed-by: Harald Nordgren <haraldnordgren@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/go_test.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/testdata/importcycle/src/selfimport/selfimport.go [new file with mode: 0644]