You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% go test -cover .
ok fmt 0.048s coverage: 91.2% of statements
% go test -cover
PASS
test coverage for fmt: 91.2% of statements
ok fmt 0.047s(missing coverage statistics)
%
When you don't specify packages, the output is unbuffered so you can watch it run, but
that means the buffer might not be flushed and cmd/go won't see the coverage stats, so
it can't recover them from the log.
Rethink where and how this is done.
The text was updated successfully, but these errors were encountered:
The failure is purely deterministic, not a race.
go test x
has its output redirected to a pipe (and thus available for searching in the go tool)
go test
is not redirected: it is connected directly to the go command's std out and err.
The fix is probably to pass the coverage suffix ("in package xxx" or "") in testmain.go,
and then have the coverage print include the full line. Then
go test x y
would print output like
ok x coverage: (text from pipe)
ok y coverage: (text from pipe)
but go test
would just let the test output speak for itself and would not re-echo the coverage
information.
The text was updated successfully, but these errors were encountered: