-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1005 Bytes
/
Makefile
File metadata and controls
47 lines (35 loc) · 1005 Bytes
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
47
.PHONY: all
all: build fmt vet lint test
APP=gohttpclient
ALL_PACKAGES=$(shell go list ./... | grep -v "vendor")
UNIT_TEST_PACKAGES=$(shell go list ./... | grep -v "vendor")
APP_EXECUTABLE="./out/$(APP)"
setup:
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/golang/lint/golint
build-deps:
dep ensure
update-deps:
dep ensure
compile:
go build
build: build-deps compile fmt vet lint test
install:
go install ./...
fmt:
go fmt ./...
vet:
go vet ./...
lint:
@for p in $(UNIT_TEST_PACKAGES); do \
echo "==> Linting $$p"; \
golint $$p | { grep -vwE "exported (var|function|method|type|const) \S+ should have comment" || true; } \
done
test:
ENVIRONMENT=test go test $(UNIT_TEST_PACKAGES) -p=1
test-cover-html:
@echo "mode: count" > coverage-all.out
$(foreach pkg, $(ALL_PACKAGES),\
ENVIRONMENT=test go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out -o out/coverage.html