Code coverage measures the percentage of program code executed by a test suite. In Go, run `go test -cover` to expose untested branches or paths and check whether tests cover the intended functionality. section 8.3.2
Use coverage while building and reviewing tests:
- Run `go test ./... -cover` after adding tests. section 6.2.6
- Cover error cases, such as rejecting an amount whose precision exceeds its currency’s precision. section 6.2.6
- Review coverage after finalizing a library or adapter, then look for missed branches and edge cases. section 8.3.2 section 6.3.2
Testing validation and API conversion
Tests can exercise `NewAmount` with both valid input and an excessive-precision error, or verify that an API adapter converts a `session.Game` into the expected response shape. Coverage helps reveal paths that these tests do not execute. section 8.3.2 section 6.2.6
> go test ./... -cover
Run the supplied Go command to measure coverage across packages. section 6.2.6













