a3426f2571
In CL 173017, I changed the package-to-module query logic to query all possible module paths in parallel in order to reduce latency. (For long package paths, most such paths will not exist and will fail with little overhead.) The module resolution algorithm treats various kinds of non-existence as “soft errors”, to be reported only if package resolution fails, but treats any remaining errors as hard errors that should fail the query. Unfortunately, that interacted badly with the +incompatible version validation added in CL 181881, causing a regression in the 'direct' fetch path for modules using the “major branch” layout¹ with a post-v1 version on the repository's default branch. Because we did not interpret a mismatched module path as “no such module”, a go.mod file specifying the path 'example.com/foo/v2' would cause the search for module 'example.com/foo' to error out. (That regression was not caught ahead of time due to a lack of test coverage for 'go get' on a package within a /vN module.) The promotion of hard errors during parallel search also made the 'go' command less tolerant of servers that advertise 'go-import' tags for nonexistent repositories. CL 194561 mitigated that problem for HTTP servers that return code 404 or 410 for a nonexistent repository, but unfortunately a few servers in common use (notably GitLab and pre-1.9.3 releases of Gitea) do not. This change mitigates both of those failure modes by ignoring “miscellaneous” errors from shorter module paths if the requested package pattern was successfully matched against a module with a longer path. ¹https://research.swtch.com/vgo-module#from_repository_to_modules Updates #34383 Updates #34094 Change-Id: If37dc422e973eba13f3a3aeb68bc7b96e2d7f73d Reviewed-on: https://go-review.googlesource.com/c/go/+/197059 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.