forked from leanovate/gopter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (34 loc) · 1.01 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
PACKAGES=$(shell go list ./...)
all: format
@go build -v ./...
format:
@echo "--> Running go fmt"
@go fmt ./...
test:
@echo "--> Running tests"
@go test -v ./...
@$(MAKE) vet
coverage:
@echo "--> Running tests with coverage"
@echo "" > coverage.txt
for pkg in $(shell go list ./...); do \
go test -coverprofile=.pkg.coverage -covermode=atomic -v $$pkg ; \
cat .pkg.coverage >> coverage.txt ; \
done
@rm .pkg.coverage
@$(MAKE) vet
vet:
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
go get golang.org/x/tools/cmd/vet; \
fi
@echo "--> Running go tool vet $(VETARGS)"
@find . -name "*.go" | grep -v "./Godeps/" | xargs go tool vet $(VETARGS); if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for reviewal."; \
fi
refreshGodoc:
@echo "--> Refreshing godoc.org"
for pkg in $(shell go list ./...); do \
curl -d "path=$$pkg" https://godoc.org/-/refresh ; \
done