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/printer: false positive for doc comment formatting on unindented input #52605
The added blank line in the comment shows that go/printer is treating this as a doc comment, even though it's not.
It is being tricked by the lack of indentation, which I used as part of the signal for "top-level comment".
Very minor, but should do better.
% cat /tmp/x.go
package p
type T struct {
// This is not
// a doc comment.
X int
}
% gofmt /tmp/x.go
package p
type T struct {
// This is not
//
// a doc comment.
X int
}
%
Activity
gopherbot commentedon Apr 20, 2024
Change https://go.dev/cl/579978 mentions this issue:
go/printer: fix false positive doc commentgo/printer: fix false positive doc comment
Indent doc comments to avoid go doc false positives in generated apis…