Unable to analyse coverage for Golang application on Azure DevOps

Template for a good new topic, formatted with Markdown:

  • ALM used: Azure DevOps
  • Azure DevOps
  • Scanner command used when applicable:
- task: SonarCloudAnalyze@1
  displayName: Run Static Analysis (SonarCloud)
- task: SonarCloudPublish@1
  displayName: Publish Static Analysis Results (SonarCloud)
  inputs:
    pollingTimeoutSec: '300'
  • Languages of the repository: Golang
  • Error Observed
INFO: Load coverage report from '/home/vsts/work/1/s/src/coverage.out'
WARN: File '/home/vsts/work/1/s/gopath/src/XXXX/XXX/XXX/domain/XXXDatabase.go' is not included in the project, ignoring coverage
WARN: File '/home/vsts/work/1/s/gopath/src/XXXX/XXX/XXX/app/XXXHandler.go' is not included in the project, ignoring coverage
WARN: File '/home/vsts/work/1/s/gopath/src/XXXX/XXX/XXX/domain/XXXDatabase.go' is not included in the project, ignoring coverage
WARN: File '/home/vsts/work/1/s/gopath/src/XXXX/XXX/XXX/domain/XX.go' is not included in the project, ignoring coverage
WARN: File '/home/vsts/work/1/s/gopath/src/XXXX/XXX/XXX/app/app.go' is not included in the project, ignoring coverage

I cannot get it to work out that the files are the same as what is in the coverage.out report

Example of coverage.out:

mode: set
XXXX/XXX/XXX/app/routes.go:13.134,21.2 4 0
XXXX/XXX/XXX/app/app.go:26.13,30.2 3 1
XXXX/XXX/XXX/app/app.go:32.14,60.12 10 0
XXXX/XXX/XXX/app/app.go:66.2,76.16 8 0
XXXX/XXX/XXX/app/app.go:79.2,81.12 3 0
XXXX/XXX/XXX/app/app.go:60.12,61.46 1 0
XXXX/XXX/XXX/app/app.go:61.46,63.4 1 0
XXXX/XXX/XXX/app/app.go:76.16,78.3 1 0

Hello @benhdev

I invite you to have a look there:

And there for a nice example of how someone configured his project.

Hope it will lead you in your research.

Best,
Quentin