代码拉取完成,页面将自动刷新
# 定制goctl名称、不知道改啥就直接写goctl
GO_CTL_NAME=goctl
# go-zero生成代码风格
#GO_ZERO_STYLE=goZero #推荐使用这一种风格
GO_ZERO_STYLE=gozero
GO ?= go
GOFMT ?= gofmt "-s"
GOFILES := $(shell find . -name "*.go")
LDFLAGS := -s -w
.PHONY: test
test: # 运行项目测试
go test -v --cover ./app/core/cmd/api/internal/..
.PHONY: fmt
fmt: # 格式化代码
$(GOFMT) -w $(GOFILES)
.PHONY: gen-admin-api
gen-admin-api: # 生成 core-api 的代码
$(GO_CTL_NAME) api go -api app/core/cmd/api/core.api -dir app/core/cmd/api --style=$(GO_ZERO_STYLE)
@echo "Generate core-api files successfully"
.PHONY: gen-all
gen-all: # 生成全部api和rpc代码
make gen-admin-api
#make gen-admin-rpc
@echo "Generate all files successfully"
.PHONY: help
help: # 显示帮助
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。