]> Cypherpunks repositories - gostls13.git/commit
cmd/go: fix "go test -n -cover" glitch with no-test packages
authorThan McIntosh <thanm@google.com>
Wed, 12 Jun 2024 19:58:36 +0000 (19:58 +0000)
committerThan McIntosh <thanm@google.com>
Thu, 13 Jun 2024 20:51:32 +0000 (20:51 +0000)
commitd06c9b4ea14c75a01a8a967fff67ca50b0589e75
tree9e6405befac45439756fc9a572b0d881d8c4ee66
parentadc5b559dbc7e86e4d8c4265d7da31f97fb0cb59
cmd/go: fix "go test -n -cover" glitch with no-test packages

Invoking "go test -n -cover ./..." on a collection of packages that
includes at least one package with code but no tests can result in
spurious error of the form

  my/package: open $WORK/b112/covmeta.b07a5f2dff1231cae3a6bdd70c8cc7c19da16abf8ac59747d8e9859c03594d37: no such file or directory

This patch fixes this issue by ensuring that we stub out some of the
meta-data file handling for no-test packages if "-n" is in effect.

Fixes #67952.

Change-Id: Ic6160c275abdec5e5b8beecc6a59accb2b8cfe7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/592201
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/work/cover.go
src/cmd/go/testdata/script/list_n_cover.txt [new file with mode: 0644]