aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api/goapi.go
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2020-12-08 19:44:33 -0500
committerDmitri Shuralyov <dmitshur@golang.org>2020-12-09 16:57:37 +0000
commit5627a4dc3013fed02c4b8097413643b682cac276 (patch)
treefd990147fc8880fd5782f515e1d2c68142d5c281 /src/cmd/api/goapi.go
parentdb6032dd0cbce3e4feff0160287cbe3d9234a540 (diff)
downloadgo-5627a4dc3013fed02c4b8097413643b682cac276.tar.xz
runtime/metrics: simplify test to support more environments
go test sets the working directory to that of the package being tested, so opening one of the package source files can be done in a simpler way. This also allows the test to run in more environments, for example when GOROOT_FINAL¹ is set. Also remove the testenv.HasSrc-like check for Go source. The doc.go file is a part of the package being built and tested, so it's expected to be available. If it's important for this test to handle when a test binary is built with go test -c and executed elsewhere without package source files, something more than testenv.HasSrc would be needed. ¹ https://golang.org/cmd/go/#hdr-Environment_variables Fixes #43085. Change-Id: Ie6ade395a8fc7beebdadbad6f4873800138dfc26 Reviewed-on: https://go-review.googlesource.com/c/go/+/276452 Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Trust: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/cmd/api/goapi.go')
0 files changed, 0 insertions, 0 deletions