-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (27 loc) · 803 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (27 loc) · 803 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
GOLANGCI_LINT_VERSION := v2.13.2
GOLANGCI_LINT := $(shell go env GOPATH)/bin/golangci-lint
.PHONY: all build test coverage lint fmt check-fmt tidy clean check ci
all: build check
build:
go build ./...
test:
go test -v -race ./...
coverage:
go test -v -covermode=count -coverpkg=./... -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
$(GOLANGCI_LINT):
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run
fmt: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) fmt
check-fmt: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) fmt --diff
tidy:
go mod tidy
clean:
rm -f coverage.out
@test -x $(GOLANGCI_LINT) && $(GOLANGCI_LINT) cache clean || true
go clean -testcache
check: test lint check-fmt
ci: check coverage