Sonar shows %0.0 coverage for a go project

Must-share information (formatted with Markdown):

  • which versions are you using:
    SonarQube: Community EditionVersion 7.9.1 (build 27448)
    Scanner: SonarQube Scanner 4.0.0.1744
    Golang: go version go1.13.1 linux/amd64

  • what are you trying to achieve
    I’m trying to run Sonar scan on a simple go project which has %100 test coverage. But sonar does not report that.

  • what have you tried so far to achieve this
    I’ve used the suggested sonar-project.properties. I run sonar-scanner in my VM against SonarQube running in docker.

My sample go project is luhn. It’ll be great if someone can show me the proper configuration that makes sonar to show the actual code coverage instead of %0.0.

thanks

Hi,

Welcome to the community!

In looking at your sonar-project.properties I don’t see you passing in the coverage report.

 
Ann

Hi Ann,

Haha! Amateur hour! Thanks for the quick reply. that resolved the issue.

Abtin