File tree 2 files changed +19
-1
lines changed 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ func (x *FileSyntax) Cleanup() {
225
225
if ww == 0 {
226
226
continue
227
227
}
228
- if ww == 1 {
228
+ if ww == 1 && len ( stmt . RParen . Comments . Before ) == 0 {
229
229
// Collapse block into single line.
230
230
line := & Line {
231
231
Comments : Comments {
Original file line number Diff line number Diff line change @@ -90,6 +90,24 @@ var addRequireTests = []struct {
90
90
)
91
91
` ,
92
92
},
93
+ {
94
+ `unattached_comments` ,
95
+ `
96
+ module m
97
+ require (
98
+ foo v0.0.0-00010101000000-000000000000
99
+ // bar v0.0.0-00010101000000-000000000000
100
+ )
101
+ ` ,
102
+ "foo" , "v0.0.0-00010101000000-000000000000" ,
103
+ `
104
+ module m
105
+ require (
106
+ foo v0.0.0-00010101000000-000000000000
107
+ // bar v0.0.0-00010101000000-000000000000
108
+ )
109
+ ` ,
110
+ },
93
111
}
94
112
95
113
type require struct {
You can’t perform that action at this time.
0 commit comments