internal/testenv: add NeedsGo helper

Some tests and packages need the go command.
For example, go.dev/cl/499255 adds a package that uses `go mod
download` and some of its tests won't work if the test environment
doesn't have 'go' (e.g. android, ios, wasi/wasm builders).
NeedsGo skips the calling tests if 'go' isn't available.
x/tools and go projects have similar facilities already, but
this is simpler than golang.org/x/tools/internal/testenv's NeedsTool
or Go project's src/internal/testenv's MustHaveGoBuild.
We just check whether `go env GOROOT` returns something convincing.

Change-Id: I96b7e7ddb5a6b7feb02ab02fefd8e14451eecb82
Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/499919
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2 files changed
tree: 1fdc9d6187d75d4741e9cbab92456e468533b2e2
  1. config/
  2. godev/
  3. internal/
  4. CONTRIBUTING.md
  5. doc.go
  6. go.mod
  7. go.sum
  8. LICENSE
  9. PATENTS
  10. README.md
  11. types.go
README.md

Go Telemetry

This repository holds the Go Telemetry server code and libraries.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/telemetry:” in the subject line, so it is easy to find.