From 796dd5b6e2df35969a0c8716dd5f26b19e506ef8 Mon Sep 17 00:00:00 2001 From: yangjinheng <420123641@qq.com> Date: Sat, 19 Oct 2024 23:37:44 +0800 Subject: [PATCH] fix the source code directory after the soft link (#4425) --- tools/goctl/rpc/generator/genpb.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/goctl/rpc/generator/genpb.go b/tools/goctl/rpc/generator/genpb.go index 65761a102906..ceb50fd9ddb3 100644 --- a/tools/goctl/rpc/generator/genpb.go +++ b/tools/goctl/rpc/generator/genpb.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/zeromicro/go-zero/tools/goctl/rpc/execx" + "github.com/zeromicro/go-zero/tools/goctl/util/pathx" ) // GenPb generates the pb.go file, which is a layer of packaging for protoc to generate gprc, @@ -88,7 +89,7 @@ func findPbFile(current string, src string, grpc bool) (string, error) { return nil }) if errors.Is(err, os.ErrExist) { - return filepath.Dir(filepath.Join(current, ret)), nil + return pathx.ReadLink(filepath.Dir(filepath.Join(current, ret))) } return "", err }