]> Cypherpunks repositories - gostls13.git/commit
cmd/go: fix bad error message in coverage for package without non-test files
authorRob Pike <r@golang.org>
Thu, 15 Aug 2013 00:36:46 +0000 (10:36 +1000)
committerRob Pike <r@golang.org>
Thu, 15 Aug 2013 00:36:46 +0000 (10:36 +1000)
commitf718036217df2d3386fb6eb72cc6bdcf156f6fc8
tree2df3340bb765dba67f86d9f140cf41b58bd31cfc
parent727b2b6f7dbec2bed608e3c97129c3bb7bab0547
cmd/go: fix bad error message in coverage for package without non-test files
Was checking for nil map; must check for empty map instead.

Fixes #6065

Before:

go test -cover
# testmain
/var/folders/00/013l0000h01000cxqpysvccm0004fc/T/go-build233480051/_/Users/r/issue/_test/_testmain.go:11: imported and not used: "_/Users/r/issue"
FAIL _/Users/r/issue [build failed]

Now:

go test -cover
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok   _/Users/r/issue 0.021s

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12916043
src/cmd/go/test.go