SonarGo does not generate its own test coverage report, but re-uses the one generated by the native Go coverage tool.

  1. Prior to the SonarQube analysis, execute your unit tests and generate the coverage report using such command:

    go test -coverprofile=coverage.out

  2. Import this report while running the SonarQube analysis by providing the paths of the coverage report through the following properties. The paths may be absolute or relative to the project base directory.



    Project-widecomma-separated list of paths to coverage report files. Ant patterns relative to project root are supported since SonarGo 1.1.