-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (25 loc) · 855 Bytes
/
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
help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
fmt: ## fmt code
gofmt -s -w .
goimports -w .
@echo gofmt -l
@OUTPUT=`gofmt -l . 2>&1`; \
if [ "$$OUTPUT" ]; then \
echo "gofmt must be run on the following files:"; \
echo "$$OUTPUT"; \
exit 1; \
fi
lint: ## lint code
@echo golangci-lint run --skip-files \".*test.go\" -v ./...
@OUTPUT=`command -v golangci-lint >/dev/null 2>&1 && golangci-lint run --skip-files ".*test.go" -v ./... 2>&1`; \
if [ "$$OUTPUT" ]; then \
echo "go lint errors:"; \
echo "$$OUTPUT"; \
fi
default: fmt lint ## fmt code
build: ## build binary
GOOS=linux GOARCH=amd64 go build -o release/linux/amd64/plugin
clean: ## clean
rm -rf release
.PHONY : build clean