From ef9f366a296c5464a3d5bf5a7d3d19e46385107c Mon Sep 17 00:00:00 2001 From: zhouyonggao <1971162852@qq.com> Date: Sat, 20 Dec 2025 14:21:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(grpc):=20=E6=9B=B4=E6=96=B0=20gRPC=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 user_client.go 中的 gRPC 用户客户端路径引用,使用相对路径以避免对 grpc 目录的修改。 - 移除 go.mod 中关于 grpc/user/userv1 的本地模块使用说明,简化依赖管理。 --- server/go.mod | 3 +-- server/internal/grpc/user_client.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/server/go.mod b/server/go.mod index c1e1444..b3f3a4b 100644 --- a/server/go.mod +++ b/server/go.mod @@ -26,6 +26,5 @@ require ( google.golang.org/protobuf v1.32.0 // indirect ) -// 使用本地 grpc 生成的代码 -// 注意:grpc/user/userv1 目录下的代码需要作为本地模块使用 +// 使用本地 grpc 生成的代码(不修改 grpc 目录) replace grpc/user/userv1 => ../grpc/user/userv1 diff --git a/server/internal/grpc/user_client.go b/server/internal/grpc/user_client.go index a5a97cd..c05fbff 100644 --- a/server/internal/grpc/user_client.go +++ b/server/internal/grpc/user_client.go @@ -11,7 +11,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/keepalive" - // 使用生成的 proto 代码 + // 使用生成的 proto 代码(通过 go.mod replace 指向本地目录,不修改 grpc 目录) userv1 "grpc/user/userv1" )