更方便的协议代理生成

This commit is contained in:
UnKownOwO
2023-03-26 12:38:45 +08:00
parent a5ad9cd65e
commit fed2c3ca4a
2 changed files with 7 additions and 1 deletions

View File

@@ -104,4 +104,8 @@ gen_proto:
# 生成客户端协议代理功能所需的代码 # 生成客户端协议代理功能所需的代码
.PHONY: gen_client_proto .PHONY: gen_client_proto
gen_client_proto: gen_client_proto:
cd gate/client_proto && rm -rf client_proto_gen.go && go test -count=1 -v -run TestClientProtoGen . cd gate/client_proto && \
rm -rf client_proto_gen.go && \
go test -count=1 -v -run TestClientProtoGen . && \
rm -rf proto/*.pb.go && \
find proto -name '*.proto' | xargs -n 1000 protoc --proto_path=proto --go_out=proto

View File

@@ -39,6 +39,8 @@ func TestClientProtoGen(t *testing.T) {
fileData += "\n" fileData += "\n"
fileData += "func (c *ClientCmdProtoMap) LoadClientCmdIdAndCmdName() {\n" fileData += "func (c *ClientCmdProtoMap) LoadClientCmdIdAndCmdName() {\n"
for _, clientCmdLine := range clientCmdLineList { for _, clientCmdLine := range clientCmdLineList {
// 清理空格以及换行符之类的
clientCmdLine = strings.TrimSpace(clientCmdLine)
if clientCmdLine == "" { if clientCmdLine == "" {
continue continue
} }