]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use the correct gofmt binary in TestScript/fmt_load_errors
authorBryan C. Mills <bcmills@google.com>
Thu, 10 Mar 2022 22:21:40 +0000 (17:21 -0500)
committerBryan Mills <bcmills@google.com>
Fri, 11 Mar 2022 05:06:51 +0000 (05:06 +0000)
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 <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go/testdata/script/fmt_load_errors.txt

index 84bf41cfbafacd175597b77c26b9525e8f4c6e03..559dcc5fe305c466e69b1b65647d8c105b382d3c 100644 (file)
@@ -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 --