Closed
Description
What version of Go are you using (go version
)?
$ go-tip version go version devel +9a8b497240 Thu Dec 5 02:00:50 2019 +0000 darwin/amd64
Does this issue reproduce with the latest release?
This is present in tip, not in go1.13.3.
What operating system and processor architecture are you using (go env
)?
go env
Output
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/rhys/Library/Caches/go-build" GOENV="/Users/rhys/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GONOPROXY="*" GONOSUMDB="*" GOOS="darwin" GOPATH="/Users/rhys/go" GOPRIVATE="*" GOPROXY="direct" GOROOT="/usr/local/go" GOSUMDB="off" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/49/zmds5zsn75z1283vtzxyfr5hj7yjq4/T/go-build076155176=/tmp/go-build -gno-record-gcc-switches -fno-common"
The important part of that output is that I have GONOPROXY
and GOPRIVATE
set to *
.
What did you do?
I ran (cd ./src && ./all.bash)
with GONOPROXY="*"
and GOPRIVATE="*"
in my environment.
What did you expect to see?
I expected all.bash to pass, and for each test to either have the correct results or to be intentionally skipped.
What did you see instead?
When either GONOPROXY
or GOPRIVATE
is set to *
, TestMissingImportErrorRepetition
fails.
$ GONOPROXY= GONOSUMDB=* GOPRIVATE= GOPROXY=direct go-tip test go/build -run=TestMissingImportErrorRepetition -count=1
ok go/build 0.052s
$ GONOPROXY=* GONOSUMDB=* GOPRIVATE= GOPROXY=direct go-tip test go/build -run=TestMissingImportErrorRepetition -count=1
--- FAIL: TestMissingImportErrorRepetition (0.24s)
build_test.go:526: package path "example.com/hello" appears in error 3 times; should appear once
error: cannot find module providing package example.com/hello: unrecognized import path "example.com/hello": reading https://example.com/hello?go-get=1: 404 Not Found
FAIL
FAIL go/build 0.270s
FAIL
$ GONOPROXY= GONOSUMDB=* GOPRIVATE=* GOPROXY=direct go-tip test go/build -run=TestMissingImportErrorRepetition -count=1
--- FAIL: TestMissingImportErrorRepetition (0.24s)
build_test.go:526: package path "example.com/hello" appears in error 3 times; should appear once
error: cannot find module providing package example.com/hello: unrecognized import path "example.com/hello": reading https://example.com/hello?go-get=1: 404 Not Found
FAIL
FAIL go/build 0.261s
FAIL
$ GONOPROXY=* GONOSUMDB=* GOPRIVATE=* GOPROXY=direct go-tip test go/build -run=TestMissingImportErrorRepetition -count=1
--- FAIL: TestMissingImportErrorRepetition (0.24s)
build_test.go:526: package path "example.com/hello" appears in error 3 times; should appear once
error: cannot find module providing package example.com/hello: unrecognized import path "example.com/hello": reading https://example.com/hello?go-get=1: 404 Not Found
FAIL
FAIL go/build 0.270s
FAIL
The test is new for #34752. Is a short/deduplicated error message right in this case too? CC @bcmills
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
bcmills commentedon Dec 5, 2019
Thanks for the report. In this case I think the duplication in the
https://
URL might not be terrible to retain, but the duplication betweencannot find module
andunrecognized import path
should probably be eliminated.CC @jayconrod
gopherbot commentedon Dec 6, 2019
Change https://golang.org/cl/210338 mentions this issue:
cmd/go: reduce redundancy in direct mode lookup error messages
gopherbot commentedon Dec 6, 2019
Change https://golang.org/cl/210342 mentions this issue:
cmd/go/internal/modload: revert duplicate path suppression in modload.ImportMissingError
cmd/go/internal/modload: revert duplicate path suppression in modload…