]> Cypherpunks repositories - gostls13.git/commit
cmd/go: avoid passing testing.T to isCaseSensitive and goVersion
authorBryan C. Mills <bcmills@google.com>
Tue, 19 Jul 2022 19:55:01 +0000 (15:55 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 18 Aug 2022 14:53:01 +0000 (14:53 +0000)
commit741ab7e819538ef84ce7a2e560730c6212e95161
tree5dd18eeb673dd330a7d8cd202b83878de3618e61
parente64c87157d1e8fbc512a670b8c0af8abc3afa7c1
cmd/go: avoid passing testing.T to isCaseSensitive and goVersion

The previous implementation of isCaseSensitive called t.Fatalf in the
wrong place, causing tests after the first to proceed past an error
determining case-sensitivity. That could lead to confusing errors.

(Moreover, I would like to try to disentangle the script engine from
testing.T so that I can also use it to generate serving contents in
the replacement for vcs-test.golang.org.)

The implementation of goVersion called ts.fatalf, which is probably
fine but prevents the script environment from being computed outside
of a test, as we might want to do for debugging and other scripting.

For #27494.

Change-Id: Ibfee0704523fdcd6174b544ff84267216435025b
Reviewed-on: https://go-review.googlesource.com/c/go/+/419874
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/cmd/go/script_test.go