SonarGo with Go Module code coverage issue

  • Sonar Developer Edition 7.9
  • SonarGo 1.6
  • Coverage report

Similar this post

We are maven build using mvngolang-maven-plugin, and able to get mvngolang to create target/coverage.out at each maven module

We have correct settings of


maven sonar:sonar shows the following warings

 [WARNING] File 'xxxx/yyyyy.go' is not included in the project, ignoring coverage

xxxx is Go Module name yyyy.go is under ${project.basedir}/src

It would like to know if any one able to get Go with Go Module code coverage working yet?



@sonargo team, do you a sample of Go module with code coverge showin up at sonarq?



xxxx/yyyyy.go displayed in the log is just read from your coverage report. According to

xxxx/yyyyy.go is not a correct path. Coverage report should either contain absolute paths or paths relative to a project base directory.

Here is the code which does file resolution, may be it will help you to clarify what’s going on ->

Great news, I am able to use antrun to alter the paths to use full path under coverage.out before running sonar:sonar goal. It works

However, It would be great if Sonar Go can be more Go Module aware? so we dont the implemnt this work around?

hello @dantran,

we plan to do that, here is the ticket
However, I can not provide any ETA for it.

Thanks @saberduck looking forward for the fix but I am all good with work around