-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (43 loc) · 779 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Go parameters
GOCMD=go
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
.PHONY: install-tools
install-tools:
@which staticcheck > /dev/null || go install honnef.co/go/tools/cmd/staticcheck@latest
@which goimports > /dev/null || go install golang.org/x/tools/cmd/goimports@latest
.PHONY: all
all: test
.PHONY: test
test:
$(GOTEST) -v ./...
.PHONY: clean
clean:
$(GOMOD) tidy
rm -rf ./testdata
.PHONY: deps
deps:
$(GOGET) -u
.PHONY: lint
lint:
staticcheck ./...
.PHONY: vet
vet:
$(GOCMD) vet ./...
.PHONY: fmt
fmt:
gofmt -s -w .
.PHONY: tidy
tidy:
$(GOMOD) tidy
# Run all code checks
.PHONY: check
check: lint vet fmt test
# Download all dependencies
prepare:
$(GOMOD) download
# Update all dependencies
update:
$(GOMOD) tidy
$(GOMOD) download