-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathMakefile
41 lines (35 loc) · 1.06 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
PACKAGES=$(shell go list ./...)
all: format
@go get github.com/smartystreets/goconvey
@go build -v ./...
format:
@echo "--> Running go fmt"
@gofmt -s -w .
test:
@echo "--> Running tests"
@go test -v ./... -count=1
@$(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) || exit 1; \
done
@rm .pkg.coverage
@$(MAKE) vet
vet:
@go vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
go get golang.org/x/tools/cmd/vet; \
fi
@echo "--> Running go vet $(VETARGS)"
@find . -name "*.go" | grep -v "./Godeps/" | xargs go 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