commit | 37dd6891021a152661f432ba5349c6527c243c02 | [log] [tgz] |
---|---|---|
author | Jay Conrod <jayconrod@google.com> | Wed Sep 08 13:50:32 2021 -0700 |
committer | Jay Conrod <jayconrod@google.com> | Mon Sep 13 21:58:16 2021 +0000 |
tree | 96fd33045e1b4eee51d5c75844d5e352baafb29d | |
parent | 4be982bcc49d69e202fcb02aee4d80ce195aee1b [diff] |
modfile: in SetRequireSeparateIndirect, convert lines to blocks When reading go.mod, SetRequireSeparateIndirect will insert new requirements into the last uncommented direct-only or indirect-only block OR line. If the last such statement is a line, SetRequireSeparateIndirect converts it to a block before inserting new requirements. Cleanup will convert it back to a line later if no requirements are inserted. For golang/go#47733 Change-Id: Id8ee3b0ce2d005488ddb3d9a5349115bd93938e7 Reviewed-on: https://go-review.googlesource.com/c/mod/+/348576 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
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.