From: Bryan C. Mills Date: Thu, 10 Mar 2022 22:21:40 +0000 (-0500) Subject: cmd/go: use the correct gofmt binary in TestScript/fmt_load_errors X-Git-Tag: go1.19beta1~1091 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef7d0413c204f69f8179b50de869acf7bd1e1731;p=gostls13.git 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 --- 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 --