Proposal Details
Currently, the go test tool provides line-based coverage reporting. However, branch coverage support is not available, which limits the granularity of test coverage reporting. Adding branch coverage would be beneficial, as it would allow developers to better understand which branches (conditional paths) in their code are being executed during tests, rather than just which lines.
Not that it matters too much but another point to consider is that many other languages and testing frameworks (e.g., Python's coverage.py, Java's Jacoco) offer branch coverage.
Third party package like https://github.com/rillig/gobco implements tools that add additional instrumentations to ones generated by cmd/cover, but having this supported by official cover tool would be a nice addition to the Go testing tool.
Proposal Details
Currently, the
go testtool provides line-based coverage reporting. However, branch coverage support is not available, which limits the granularity of test coverage reporting. Adding branch coverage would be beneficial, as it would allow developers to better understand which branches (conditional paths) in their code are being executed during tests, rather than just which lines.Not that it matters too much but another point to consider is that many other languages and testing frameworks (e.g., Python's coverage.py, Java's Jacoco) offer branch coverage.
Third party package like https://github.com/rillig/gobco implements tools that add additional instrumentations to ones generated by cmd/cover, but having this supported by official cover tool would be a nice addition to the Go testing tool.