From 75c6acfc8f0d57c8419ed7aba5b5887ea000fd11 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Sun, 30 Jul 2017 02:11:56 -0600 Subject: [PATCH] cmd: Add "-u" to output unified diff in golden tests --- cobra/cmd/golden_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cobra/cmd/golden_test.go b/cobra/cmd/golden_test.go index 0ac7e893..59a5a1c9 100644 --- a/cobra/cmd/golden_test.go +++ b/cobra/cmd/golden_test.go @@ -39,11 +39,11 @@ func compareFiles(pathA, pathB string) error { // Don't execute diff if it can't be found. return nil } - diffCmd := exec.Command(diffPath, pathA, pathB) + diffCmd := exec.Command(diffPath, "-u", pathA, pathB) diffCmd.Stdout = output diffCmd.Stderr = output - output.WriteString("$ diff " + pathA + " " + pathB + "\n") + output.WriteString("$ diff -u " + pathA + " " + pathB + "\n") if err := diffCmd.Run(); err != nil { output.WriteString("\n" + err.Error()) }