-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (22 loc) · 803 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
all:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo
.PHONY: install
install: ## Install dependencies
@go mod tidy \
&& go mod vendor \
&& go mod verify
.PHONY: generate
generate: ## Generate files (e.g. mocks)
@mockgen -package rand_test -source reader.go -destination reader_test.go
.PHONY: lint
lint: ## Run linter
@golangci-lint --exclude-use-default=false run ./...
runTests:
@go test -v -coverprofile=coverage.out ./...
.PHONY: test
test: runTests ## Run tests
@if [ -f coverage.out ]; then go tool cover -func=coverage.out && rm coverage.out; fi
.PHONY: coverage
coverage: runTests ## Show coverage
@if [ -f coverage.out ]; then go tool cover -html=coverage.out && rm coverage.out; fi