-
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: defer fixing versions in retract directives
VersionFixers require both a path and a version: if the version is non-canonical (like a branch name), they generally need the path to look up the proper version. This is fine for require, replace, and exclude directives, since the path is specified with each version. For retract directives, the path comes from the module directive, which may appear later in the file. Previously, we just used the empty string, but this breaks reasonable implementations. With this change, we leave retracted versions alone until the file has been completely parsed, then we apply the version fixer to each retract directive. We report an error if retract is used without a module directive. For golang/go#44494 Change-Id: I99b7b8b55941c1fde4ee56161acfe854bcaf948d Reviewed-on: https://go-review.googlesource.com/c/mod/+/296130 Trust: Jay Conrod <[email protected]> Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Jay Conrod
committed
Feb 25, 2021
1 parent
66f6d92
commit 66bf157
Showing
2 changed files
with
169 additions
and
21 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