]> Cypherpunks repositories - gostls13.git/commit
cmd/gofmt: use actual filename in gofmt -d output
authorhaya14busa <hayabusa1419@gmail.com>
Sat, 4 Feb 2017 13:22:14 +0000 (22:22 +0900)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 8 Feb 2017 19:04:35 +0000 (19:04 +0000)
commitee7fdc26477a0eaf5382542a7822b45966a9f844
treed6a06921638bd5ccdd4823cc083ad2766fb3214a
parent894650277670eed065566f803c642a8f80437456
cmd/gofmt: use actual filename in gofmt -d output

By using actual filename, diff output of "gofmt -d" can be used with
other commands like "diffstat" and "patch".

Example:
  $ gofmt -d path/to/file.go | diffstat
  $ gofmt -d path/to/file.go > gofmt.patch
  $ patch -u -p0 < gofmt.patch

Fixes #18932

Change-Id: I21ce15eb77870d72f2c14bfd5e7c21e2c77dc9ab
Reviewed-on: https://go-review.googlesource.com/36374
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/gofmt/gofmt.go
src/cmd/gofmt/gofmt_test.go