How to generate go test -json > report.json
Golang Version: Go1.10.3
SonarQube Properties: sonar.go.tests.reportPaths = report.json
Offical Sonar Document -> https://docs.sonarqube.org/display/PLUG/Unit+Tests+Results+Import
Makefile
.PHONY: test
test:
@$(foreach package,$(packages), \
go test -coverprofile $(package)/cover.out -covermode=count $(package);)
.PHONY: cover
cover-xml:
@$(foreach package,$(packages), \
gocov convert $(package)/cover.out | gocov-xml > $(package)/coverage.xml;)