-
Notifications
You must be signed in to change notification settings - Fork 198
/
Makefile
46 lines (35 loc) · 1.09 KB
/
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
export GO111MODULE=on
build: \
build/example-simple \
build/example-cache \
build/example-httpsource \
build/example-groupcache \
build/example-advanced
build/example-simple:
go build -o build/example-simple ./examples/simple
build/example-cache:
go build -o build/example-cache ./examples/cache
build/example-httpsource:
go build -o build/example-httpsource ./examples/httpsource
build/example-groupcache:
go build -o build/example-groupcache ./examples/groupcache
build/example-advanced:
go build -o build/example-advanced ./examples/advanced
.PHONY: test
test:
go test ./...
.PHONY: lint
lint: \
golangci-lint
GOLANGCI_LINT_VERSION=v1.17.0
GOLANGCI_LINT_DIR=$(shell go env GOPATH)/pkg/golangci-lint/$(GOLANGCI_LINT_VERSION)
$(GOLANGCI_LINT_DIR):
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOLANGCI_LINT_DIR) $(GOLANGCI_LINT_VERSION)
.PHONY: install-golangci-lint
install-golangci-lint: $(GOLANGCI_LINT_DIR)
.PHONY: golangci-lint
golangci-lint: install-golangci-lint
$(GOLANGCI_LINT_DIR)/golangci-lint run
.PHONY: clean
clean:
rm -rf build