From 62a72cdd0fa76b1905684d786f31c3edb43028c1 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral <38422348+umarcor@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:17:12 +0000 Subject: [PATCH] fix(diff): use arg '--strip-trailing-cr' (#949) In tests with diff, ignores trailing carriage returns (so tests pass on windows) --- cobra/cmd/golden_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobra/cmd/golden_test.go b/cobra/cmd/golden_test.go index 99b92e31b..832ea5334 100644 --- a/cobra/cmd/golden_test.go +++ b/cobra/cmd/golden_test.go @@ -43,7 +43,7 @@ func compareFiles(pathA, pathB string) error { // Don't execute diff if it can't be found. return nil } - diffCmd := exec.Command(diffPath, "-u", pathA, pathB) + diffCmd := exec.Command(diffPath, "-u", "--strip-trailing-cr", pathA, pathB) diffCmd.Stdout = output diffCmd.Stderr = output