|author||Jay Conrod <email@example.com>||Wed Feb 24 17:55:24 2021 -0500|
|committer||Dmitri Shuralyov <firstname.lastname@example.org>||Tue Mar 02 22:50:16 2021 +0000|
[internal-branch.go1.16-vendor] 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#44496 Change-Id: I99b7b8b55941c1fde4ee56161acfe854bcaf948d Reviewed-on: https://go-review.googlesource.com/c/mod/+/296130 Trust: Jay Conrod <email@example.com> Run-TryBot: Jay Conrod <firstname.lastname@example.org> TryBot-Result: Go Bot <email@example.com> Reviewed-by: Bryan C. Mills <firstname.lastname@example.org> (cherry picked from commit 66bf157bf5bcd4cf5e82f17680e12c7fc873a2c1) Reviewed-on: https://go-review.googlesource.com/c/mod/+/298010 Reviewed-by: Dmitri Shuralyov <email@example.com>
This repository holds packages for writing tools that work directly with Go module mechanics. That is, it is for direct manipulation of Go modules themselves.
It is NOT about supporting general development tools that need to do things like load packages in module mode. That use case, where modules are incidental rather than the focus, should remain in x/tools, specifically x/tools/go/packages.
The specific case of loading packages should still be done by invoking the go command, which remains the single point of truth for package loading algorithms.