Commit be48115f authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

gofix: fix diff regression from exec change

Also pass -u to diff to be consistent with gofmt.

Fixes #1619

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4591041
parent 63dae3c3
......@@ -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
}
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