You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
go/parser: files parsed with mode 'parser.ImportsOnly|parser.ParseComments' can contain a comment after import declaration #47778
"F func\n" is an extra comment because the documentation for parser.ImportsOnly says stop parsing after import declarations. However, if an import declaration is followed by any code without comments, there will be no extra comments. For example:
// Package mainpackage main
import (
_ "fmt"// fmt import
)
varA=1// F funcfuncF() {}
Activity
mknyszek commentedon Aug 18, 2021
CC @griesemer via https://dev.golang.org/owners.
mknyszek commentedon Aug 18, 2021
@ShoshinNikita is this new in 1.17? Putting in backlog for now assuming it isn't.
ShoshinNikita commentedon Aug 18, 2021
@mknyszek I discovered this bug before 1.17 release
gopherbot commentedon Aug 18, 2021
Change https://golang.org/cl/343369 mentions this issue:
go/parser: fix incorrect comment parsing