-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
58 lines (45 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
SHELL := /bin/bash
GO111MODULE = on
build:
go build
.PHONY: build
test:
go test -v ./...
.PHONY: test
protobuf:
protoc --go_out=. ./protobuf/*.proto
.PHONY: protobuf
lint:
golangci-lint run -v
.PHONY: lint
install-linter:
# install linter
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.17.1
.PHONY: install-linter
mock-install:
go get -u github.com/golang/mock/mockgen
go get -u github.com/golang/mock
.PHONY: mock-install
mock:
mockgen -package=internal -destination=node/internal/syncstate_mock.go -source=state/state.go
.PHONY: mock
vendor:
go mod tidy
go mod vendor
modvendor -copy="**/*.c **/*.h" -v
.PHONY: vendor
generate:
go generate ./...
.PHONY: generate
create-migration:
@if [ -z "$$DIR" ]; then \
echo 'missing DIR var'; \
exit 1; \
fi
@if [ -z "$$NAME" ]; then \
echo 'missing NAME var'; \
exit 1; \
fi
mkdir -p $(DIR)
touch $(DIR)/`date +"%s"`_$(NAME).down.sql ./$(DIR)/`date +"%s"`_$(NAME).up.sql
.PHONY: create-migration