forked from RedisTimeSeries/redistimeseries-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 726 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
# Go parameters
GOCMD=GO111MODULE=on go
GOBUILD=$(GOCMD) build
GODOC=GO111MODULE=on godoc
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOFMT=$(GOCMD) fmt
.PHONY: all test coverage
all: test coverage
checkfmt:
@echo 'Checking gofmt';\
bash -c "diff -u <(echo -n) <(gofmt -d .)";\
EXIT_CODE=$$?;\
if [ "$$EXIT_CODE" -ne 0 ]; then \
echo '$@: Go files must be formatted with gofmt'; \
fi && \
exit $$EXIT_CODE
lint:
@golangci-lint run
doc:
$(GODOC)
get:
$(GOGET) -t -v ./...
fmt:
$(GOFMT) ./...
test: get fmt
$(GOTEST) -count=1 -race -covermode=atomic ./...
coverage: get test
$(GOTEST) -race -coverprofile=coverage.txt -covermode=atomic .