Commit 52289f1
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: 1477d7c
GitHub-Pull-Request: #22
Reviewed-on: https://go-review.googlesource.com/c/mod/+/634875
Reviewed-by: Michael Matloob <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>1 parent dec0365 commit 52289f1
3 files changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
880 | 885 | | |
881 | 886 | | |
882 | 887 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments