-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/printer: do not treat comments inside a ast.Decl as godoc
This change makes sure that we do not format comments as doc comments inside of a declaration and makes the go doc formatter idempotent: Previously: // test comment //go:directive2 // test comment func main() { } was formatted to: // test comment //go:directive2 // test comment func main() { } after another formatting, it got formatted with doc rules into: // test comment // test comment // //go:directive2 func main() { } With this change it gets directly to the correct form (last one). Change-Id: Id7d8f03e43474357cd714e0672e886652c3fce86 GitHub-Last-Rev: 9833b87 GitHub-Pull-Request: #69134 Reviewed-on: https://go-review.googlesource.com/c/go/+/609077 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com>
- Loading branch information
1 parent
89958ab
commit c3f1630
Showing
3 changed files
with
201 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters