Skip to content

Instantly share code, notes, and snippets.

@simonswine
Created August 25, 2018 13:01
Show Gist options
  • Save simonswine/e5c1129988ef25369eb1dc435a02013d to your computer and use it in GitHub Desktop.
Save simonswine/e5c1129988ef25369eb1dc435a02013d to your computer and use it in GitHub Desktop.
sonarqube golang
go test -json $(go list ./... | grep -v /vendor/) -coverprofile report_coverage.cov > report_gotest.json
~/sonar-scanner \
-Dsonar.sources=./ \
-Dsonar.sources.inclusions=**/**.go \
-Dsonar.exclusions="vendor/**" \
-Dsonar.tests=./ \
-Dsonar.test.inclusions=**/**_test.go \
-Dsonar.go.tests.reportPaths="report_gotest.json" \
-Dsonar.go.coverage.reportPaths="report_coverage.cov"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment