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 now prints coverage summaries for covered packages that do not have their own test files. Prior to Go 1.22 a go test -cover run for such a package would report
? mymod/mypack [no test files]
and now with Go 1.22, functions in the package are treated as uncovered:
go test -cover now prints coverage summaries for covered packages that do not have their own test files. Prior to Go 1.22 a go test -cover run for such a package would report
? mymod/mypack [no test files]
and now with Go 1.22, functions in the package are treated as uncovered:
mymod/mypack coverage: 0.0% of statements
Note that if a package contains no executable code at all, we can't report a meaningful coverage percentage; for such packages the go tool will continue to report that there are no test files.
Example
I dunno, I kind of liked the previous behaviour because it was obvious the package contained no tests, seems like a step back?
Dropped a golang/go#24570 (comment) upstream, but I think that's moot. And I'm probably in the minority that preferred the existing behaviour, so there's probably not much we can do here to aid users outside suggestion scanning for 0.0% when running -cover.
Reference: go1.22 Release Notes
We'll need to handle this, since
?.*[no test files]
was the only way to get at packages without test files.The text was updated successfully, but these errors were encountered: