2022-05-10 15:38:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: tidy
|
|
|
|
|
tidy:
|
|
|
|
|
$(eval files=$(shell find . -name go.mod))
|
|
|
|
|
@set -e; \
|
|
|
|
|
for file in ${files}; do \
|
|
|
|
|
goModPath=$$(dirname $$file); \
|
|
|
|
|
cd $$goModPath; \
|
|
|
|
|
go mod tidy; \
|
|
|
|
|
cd -; \
|
|
|
|
|
done
|
|
|
|
|
|
2022-11-01 20:12:21 +08:00
|
|
|
.PHONY: lint
|
|
|
|
|
lint:
|
2023-03-28 09:25:29 +08:00
|
|
|
golangci-lint run
|
|
|
|
|
|
|
|
|
|
gftidy:
|
|
|
|
|
$(eval files=$(shell find . -name go.mod))
|
|
|
|
|
@set -e; \
|
|
|
|
|
for file in ${files}; do \
|
|
|
|
|
goModPath=$$(dirname $$file); \
|
|
|
|
|
echo "Processing dir: $$goModPath"; \
|
|
|
|
|
if [[ $$goModPath =~ ".git" || $$goModPath == "." ]] ; then \
|
|
|
|
|
echo "Skip path"; \
|
|
|
|
|
elif [[ $$goModPath =~ "./cmd/gf" || $$goModPath =~ "./example" ]] ; then \
|
|
|
|
|
echo "Skip path"; \
|
|
|
|
|
else \
|
|
|
|
|
cd $$goModPath; \
|
|
|
|
|
go get -u -v github.com/gogf/gf/v2; \
|
|
|
|
|
go mod tidy; \
|
|
|
|
|
cd -; \
|
|
|
|
|
fi \
|
|
|
|
|
done
|