-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/gofmt: gofmt -r should preserve attached comments through a rewrite #7417
Labels
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Comments
This just bit me trying to use "gofmt -r" while working on issue #10055:
|
mdempsky
added a commit
that referenced
this issue
Apr 20, 2015
The majority of this CL was prepared via scripted invocations of `gofmt -w -r "$SYM -> obj.$SYM" cmd/internal/ld/*.go` and `gofmt -w -r "ld.$SYM -> obj.$SYM" cmd/?l/*.go`. Because of issue #7417, that was followed by repeatedly running an AWK script to identify lines that differed other than whitespace changes or "ld." or "obj." prefixes and manually restoring comments. Finally, the redundant constants from cmd/internal/ld/link.go were removed, and "goimports -w" was used to cleanup import lines. Passes rsc.io/toolstash/buildall, even when modified to also build cmd. Fixes #10055. Change-Id: Icd5dbe819a3b6520ce883748e60017dc8e9a2e85 Reviewed-on: https://go-review.googlesource.com/9112 Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Another test case. I was refactoring an example and the replacement happened on the line just before the
|
andybons
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Mar 8, 2018
Another test case: package main
// comment |
And another test case, taken from my gobco project: package main
//go:generate go run build/gen.go Reproducible with go1.14 bf3ee57 from today. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: