mirror of
https://github.com/golang/go
synced 2024-11-19 15:05:00 -07:00
gofmt: fix -d regression from exec change
Fixes #1916 R=golang-dev, gri CC=golang-dev https://golang.org/cl/4590041
This commit is contained in:
parent
f2f3b8fa99
commit
687102ed4f
@ -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
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user