-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
31 lines (25 loc) · 923 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
29
30
31
PROJECT_DIR = $(shell pwd)
PROJECT_BIN = $(PROJECT_DIR)/bin
$(shell [ -f bin ] || mkdir -p $(PROJECT_BIN))
PATH := $(PROJECT_BIN):$(PATH)
GOLANGCI_LINT = $(PROJECT_BIN)/golangci-lint
GOLANGCI_LINT_VERSION = v1.50.1
.PHONY: .install-linter
.install-linter:
### INSTALL GOLANGCI-LINT ###
[ -f $(PROJECT_BIN)/golangci-lint ] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) $(GOLANGCI_LINT_VERSION)
.PHONY: lint
lint: .install-linter
### RUN GOLANGCI-LINT ###
$(GOLANGCI_LINT) run ./... --config=./.golangci.yml
.PHONY: lint-fast
lint-fast: .install-linter
$(GOLANGCI_LINT) run ./... --fast --config=./.golangci.yml
# === Test ===
.PHONY: test
test:
go test -v --race --timeout=5m --cover ./...
.PHONY: test-coverage
test-coverage:
go test -v --timeout=5m --covermode=count --coverprofile=coverage.out ./...
go tool cover --func=coverage.out