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" )