From ef7d0413c204f69f8179b50de869acf7bd1e1731 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 10 Mar 2022 17:21:40 -0500 Subject: [PATCH] cmd/go: use the correct gofmt binary in TestScript/fmt_load_errors Otherwise, this test may fail when GOROOT/bin is not in $PATH. Change-Id: Id744f365f6604716207184c9ea49436ab2e3a835 Reviewed-on: https://go-review.googlesource.com/c/go/+/391802 Trust: Bryan Mills Run-TryBot: Bryan Mills Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot --- src/cmd/go/testdata/script/fmt_load_errors.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/testdata/script/fmt_load_errors.txt b/src/cmd/go/testdata/script/fmt_load_errors.txt index 84bf41cfba..559dcc5fe3 100644 --- a/src/cmd/go/testdata/script/fmt_load_errors.txt +++ b/src/cmd/go/testdata/script/fmt_load_errors.txt @@ -7,14 +7,13 @@ stdout 'exclude[/\\]x\.go' stdout 'exclude[/\\]x_linux\.go' # Test edge cases with gofmt. -# Note that this execs GOROOT/bin/gofmt. -! exec gofmt does-not-exist +! exec $GOROOT/bin/gofmt does-not-exist -exec gofmt gofmt-dir/no-extension +exec $GOROOT/bin/gofmt gofmt-dir/no-extension stdout 'package x' -exec gofmt gofmt-dir +exec $GOROOT/bin/gofmt gofmt-dir ! stdout 'package x' -- exclude/empty/x.txt --