From fed2c3ca4a86b70fb204fec2df049480123df3ef Mon Sep 17 00:00:00 2001 From: UnKownOwO <80520429@qq.com> Date: Sun, 26 Mar 2023 12:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B9=E4=BE=BF=E7=9A=84=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E4=BB=A3=E7=90=86=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 6 +++++- gate/client_proto/client_proto_gen_test.go | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c2209dda..3aec13af 100644 --- a/Makefile +++ b/Makefile @@ -104,4 +104,8 @@ gen_proto: # 生成客户端协议代理功能所需的代码 .PHONY: 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 diff --git a/gate/client_proto/client_proto_gen_test.go b/gate/client_proto/client_proto_gen_test.go index c696d881..22d74072 100644 --- a/gate/client_proto/client_proto_gen_test.go +++ b/gate/client_proto/client_proto_gen_test.go @@ -39,6 +39,8 @@ func TestClientProtoGen(t *testing.T) { fileData += "\n" fileData += "func (c *ClientCmdProtoMap) LoadClientCmdIdAndCmdName() {\n" for _, clientCmdLine := range clientCmdLineList { + // 清理空格以及换行符之类的 + clientCmdLine = strings.TrimSpace(clientCmdLine) if clientCmdLine == "" { continue }