1
0
mirror of https://github.com/golang/go synced 2024-11-12 01:00:22 -07:00

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 <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>
This commit is contained in:
Bryan C. Mills 2022-03-10 17:21:40 -05:00 committed by Bryan Mills
parent 9743e9b6d8
commit ef7d0413c2

View 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 --