generated from RTradeLtd/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
52 lines (42 loc) · 1.09 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
43
44
45
46
47
48
49
50
51
52
.PHONY: cli
cli:
go build -o eml-util ./cmd/eml-util
# cleanup dependencies and download missing ones
.PHONY: deps
deps:
go mod tidy
go mod download
# run dependency cleanup, followed by updating the patch version
.PHONY: deps-update
deps-update: deps
go get -u=patch
# run tests
.PHONY: tests
tests:
go test -race -cover -count 1 ./...
# run standard go tooling for better rcode hygiene
.PHONY: tidy
tidy: imports fmt
go vet ./...
golint ./...
# automatically add missing imports
.PHONY: imports
imports:
find . -type f -name '*.go' -exec goimports -w {} \;
# format code and simplify if possible
.PHONY: fmt
fmt:
find . -type f -name '*.go' -exec gofmt -s -w {} \;
verifiers: staticcheck
staticcheck:
@echo "Running $@ check"
@GO111MODULE=on ${GOPATH}/bin/staticcheck ./...
gen:
protoc \
-I=pb \
-I=${GOPATH}/src \
-I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \
-I=${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
pb/email.proto \
--gogofaster_out=plugins=grpc:pb
sed -i '/_ \"google\/protobuf\"/d' pb/email.pb.go