-
Notifications
You must be signed in to change notification settings - Fork 145
/
Makefile
38 lines (30 loc) · 1011 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
.DEFAULT_GOAL := all
PACKAGE := github.com/mailgun/mailgun-go
GOPATH=$(shell go env GOPATH)
NILAWAY = $(GOPATH)/bin/nilaway
$(NILAWAY):
go install go.uber.org/nilaway/cmd/nilaway@latest
.PHONY: all
all: test
.PHONY: test
test:
go test . -race -count=1
.PHONY: godoc
godoc:
mkdir -p /tmp/tmpgoroot/doc
-rm -rf /tmp/tmpgopath/src/${PACKAGE}
mkdir -p /tmp/tmpgopath/src/${PACKAGE}
tar -c --exclude='.git' --exclude='tmp' . | tar -x -C /tmp/tmpgopath/src/${PACKAGE}
echo -e "open http://localhost:6060/pkg/${PACKAGE}\n"
GOROOT=/tmp/tmpgoroot/ GOPATH=/tmp/tmpgopath/ godoc -http=localhost:6060
# TODO(vtopc): fix mocks and enable nilaway for them too?
.PHONY: nilaway
nilaway: $(NILAWAY)
$(NILAWAY) -include-pkgs="$(PACKAGE)" -test=false -exclude-errors-in-files=mock_ ./...
# linter:
GOLINT = $(GOPATH)/bin/golangci-lint
$(GOLINT):
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.61.0
.PHONY: lint
lint: $(GOLINT)
$(GOLINT) run