update to golang.org/x/mod@latest

This commit is contained in:
Mechiel Lukkien
2024-08-22 20:41:06 +02:00
parent e7e023c6d0
commit 09b13ed4d5
7 changed files with 239 additions and 18 deletions

View File

@ -226,8 +226,9 @@ func (x *FileSyntax) Cleanup() {
continue
}
if ww == 1 && len(stmt.RParen.Comments.Before) == 0 {
// Collapse block into single line.
line := &Line{
// Collapse block into single line but keep the Line reference used by the
// parsed File structure.
*stmt.Line[0] = Line{
Comments: Comments{
Before: commentsAdd(stmt.Before, stmt.Line[0].Before),
Suffix: commentsAdd(stmt.Line[0].Suffix, stmt.Suffix),
@ -235,7 +236,7 @@ func (x *FileSyntax) Cleanup() {
},
Token: stringsAdd(stmt.Token, stmt.Line[0].Token),
}
x.Stmt[w] = line
x.Stmt[w] = stmt.Line[0]
w++
continue
}