commit | db821b54d1a8dffa85a9a3cf599f83a19184f020 | [log] [tgz] |
---|---|---|
author | Jay Conrod <jayconrod@google.com> | Wed Apr 15 12:08:24 2020 -0400 |
committer | Jay Conrod <jayconrod@google.com> | Wed Aug 26 21:12:19 2020 +0000 |
tree | 96b289a0bf8c4bfe583a8ca155309748b517c021 | |
parent | bf869c65d1a96da5db78a891430ea3acd7ddf1ab [diff] |
cmd/go/internal/modload: refactor version filtering for exclude Query and other functions now accept an "allowed" function that returns an error (previously, the function returned a bool). If the error is equivalent to ErrDisallowed, it indicates the version is excluded (or, in a future CL, retracted). This provides predicates a chance to explain why a version is not allowed. When a query refers to a specific revision (by version, branch, tag, or commit name), most callers will not use the Allowed predicate. This allows commands like 'go list -m' and 'go mod download' to handle disallowed versions when explicitly requested. 'go get' will reject excluded versions though. When a query does not refer to a specific revision (for example, "latest"), disallowed versions will not be considered. When an "allowed" predicate returns an error not equivalent to ErrDisallowed, it may be ignored or returned, depending on the case. This never happens for excluded versions, but it may happen for retractions (in a future CL). This indicates a list of retractions could not be loaded. This frequently happens when offline, and it shouldn't cause a fatal or warning in most cases. For #24031 Change-Id: I4df6fb6bd60e3e0259e5b3b4bf71a307b4b32298 Reviewed-on: https://go-review.googlesource.com/c/go/+/228379 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
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.
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.
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.
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.