-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modfile: check canonicalness against the relevant module path, not ab…
…stract semver In CL 279394 we started validating that versions in "exclude" and "retract" directives are canonical. Unfortunately, we use the semver package's notion of canonicalness, and the semver package doesn't know anything about +incompatible versions or major-version suffixes. The resulting error messages also don't indicate an appropriate fix if the problem is that the user forgot either the "+incompatible" suffix on the version string or the "/vN" suffix on the module path. This change corrects both of those problems by validating the version against the corresponding module path. (For "exclude" directives, that is the module path to be excluded; for "retract" directives, it is the module declared in the "module" directive of the same go.mod file.) For golang/go#44497 Change-Id: I39732d79c3ab3a43bb1fb8905062fe6cb26d3edc Reviewed-on: https://go-review.googlesource.com/c/mod/+/295089 Trust: Bryan C. Mills <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
- Loading branch information
Bryan C. Mills
committed
Feb 23, 2021
1 parent
6ce8bb3
commit 66f6d92
Showing
2 changed files
with
183 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters