Commit 687102ed authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

gofmt: fix -d regression from exec change

Fixes #1916

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4590041
parent f2f3b8fa
......@@ -260,5 +260,12 @@ func diff(b1, b2 []byte) (data []byte, err os.Error) {
f1.Write(b1)
f2.Write(b2)
return exec.Command("diff", "-u", 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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment