-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (43 loc) · 1.17 KB
/
Makefile
File metadata and controls
58 lines (43 loc) · 1.17 KB
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
.PHONY: build clean tool lint help
all: build
build:
@go build -v .
build-upx:
@rm -rf main
@go build -ldflags="-s -w" -o main main.go && upx -9 main; true
vet:
go vet ./pkg/...; true
go vet ./test/...; true
lint:
golint ./pkg/...
clean:
rm -rf service
rm -rf manager
go clean -i .
# go install mvdan.cc/gofumpt@latest
fmt:
@gofumpt -l -w ./pkg/
@gofumpt -l -w ./test/
# go fmt ./pkg/...
# find ./pkg -name "*.go" | xargs gofumpt -l -w
# go install github.com/xxjwxc/gormt@master
gen-model:
@gormt
gen-proto:
@cd pkg/server/grpc/gateway && protoc --go_out=plugins=grpc:. server.proto
git-push:
./cmd.sh git push
git-clear:
./cmd.sh git clear
install:
@docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
upgrade-go:
@wget https://go.dev/dl/go1.18.4.linux-amd64.tar.gz
@sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz
@rm -rf go1.18.4.linux-amd64.tar.gz
help:
@echo "make: compile packages and dependencies"
@echo "make vet: run specified go vet"
@echo "make lint: golint ./..."
@echo "make fmt: gofumpt -l -w ./pkg/"
@echo "make clean: remove object files and cached files"