forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (32 loc) · 1.03 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
42
LDFLAGS = -ldflags "-w -s"
GCTPKG = github.com/thrasher-/gocryptotrader
LINTPKG = github.com/golangci/golangci-lint/cmd/[email protected]
LINTBIN = $(GOPATH)/bin/golangci-lint
GCTLISTENPORT=9050
GCTPROFILERLISTENPORT=8085
get:
GO111MODULE=on go get $(GCTPKG)
linter:
GO111MODULE=on go get $(GCTPKG)
GO111MODULE=on go get $(LINTPKG)
test -z "$$($(LINTBIN) run --verbose | tee /dev/stderr)"
check: linter test
test:
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
build:
GO111MODULE=on go build $(LDFLAGS)
install:
GO111MODULE=on go install $(LDFLAGS)
fmt:
gofmt -l -w -s $(shell find . -type f -name '*.go')
update_deps:
GO111MODULE=on go mod verify
GO111MODULE=on go mod tidy
rm -rf vendor
GO111MODULE=on go mod vendor
.PHONY: profile_heap
profile_heap:
go tool pprof -http "localhost:$(GCTPROFILERLISTENPORT)" 'http://localhost:$(GCTLISTENPORT)/debug/pprof/heap'
.PHONY: profile_cpu
profile_cpu:
go tool pprof -http "localhost:$(GCTPROFILERLISTENPORT)" 'http://localhost:$(GCTLISTENPORT)/debug/pprof/profile'