-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Closed
Copy link
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker
Milestone
Description
What version of Go are you using (go version
)?
tip (6d95e5a)
Does this issue reproduce with the latest release?
No.
What did you do?
Run gofmt with an input file not named with ".go".
What did you expect to see?
Format the file, emit to stdout.
What did you see instead?
Emit nothing. No error either. The command succeeded silently.
$ cat x.go_
package p
$ gofmt x.go_
$ echo $?
0
It seems this is changed in CL https://go-review.googlesource.com/c/go/+/284138 .
The gofmt document ( https://golang.org/cmd/gofmt ) mentions
Given a file, it operates on that file; given a directory, it operates on all .go files in that directory, recursively.
For "a file" case, it does not clearly require ".go" (also not clearly mention it accepts non-".go" file). Previous versions of gofmt does work with non-".go" files.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker