diff options
Diffstat (limited to 'src/cmd/gofix/main.go')
-rw-r--r-- | src/cmd/gofix/main.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/gofix/main.go b/src/cmd/gofix/main.go index ba2061a00..1b091c18a 100644 --- a/src/cmd/gofix/main.go +++ b/src/cmd/gofix/main.go @@ -248,5 +248,11 @@ func diff(b1, b2 []byte) (data []byte, err os.Error) { f1.Write(b1) f2.Write(b2) - return exec.Command("diff", f1.Name(), f2.Name()).CombinedOutput() + data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() + if len(data) > 0 { + // diff exits with a non-zero status when the files don't match. + // Ignore that failure as long as we get output. + err = nil + } + return } |