commit | 52289f1fa75a8da0eb82d369cf5fda65fd6147b9 | [log] [tgz] |
---|---|---|
author | Prince Roshan <princekrroshan01@gmail.com> | Thu Jan 16 20:41:01 2025 +0000 |
committer | Michael Matloob <matloob@golang.org> | Mon Feb 03 12:02:40 2025 -0800 |
tree | 25cdb5fec3166fbffed620ae8a7bc406a31781de | |
parent | dec0365065b75edd0e98b0306f6f9b0051710ed2 [diff] |
modfile: fix trailing empty lines in require blocks This change ensures that trailing empty lines in `require` blocks are ignored during parsing itself. Specifically: - Modified the `parseLineBlock` function to detect and discard blank lines (represented by a single empty comment) at the end of a block. - Blank lines within a block are preserved as expected, but trailing blank lines immediately before the closing parenthesis are now skipped. For golang/go#70632 Change-Id: Ica76b3edb3bf7fdc327c7cdc9e401dcf19c523b0 GitHub-Last-Rev: 1477d7ce8b79b953be1bf5d7a20d4f9917347299 GitHub-Pull-Request: golang/mod#22 Reviewed-on: https://go-review.googlesource.com/c/mod/+/634875 Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.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.