diff --git a/.gitignore b/.gitignore index 3c117c4..5fc9443 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp .vscode/ -.idea/ \ No newline at end of file +.idea/ +coverage.* \ No newline at end of file diff --git a/Makefile b/Makefile index 2fbdb92..aff47a1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ PACKAGES ?= "$(shell go list ./... | grep -v tests)" test: - @go test -race $(shell echo $(PACKAGES)) + @go test ./... -coverprofile=coverage.out.tmp + cat coverage.out.tmp | grep -v "/mocks/" > coverage.out + @go tool cover -func=coverage.out + +local-coverage: test + @go tool cover -html=coverage.out -o coverage.html + @echo "\n\n open the coverage.html on your browser !!!" lint: @golangci-lint run \ No newline at end of file