chickenlj opened a new issue, #2475: URL: https://github.com/apache/dubbo-go/issues/2475
``` 刘军:  刘军:  刘军:@王宇轩 @唐启文 proto里指定的package,和生成的代码有没有必要统一那?其他框架是咋做的 陈有为-earthchen:[忍者]不加option go package 应该和 package 一样 刘军:应该已proto里为准,这里应该都是 greet 吧? 陈有为-earthchen:这个是有规范的 王宇轩:我待会看看,我记得是如果两个都叫greet不方便调用,最终还是要起个别名 王宇轩:1. option go_package是必须加的,因为go_package和proto里的package没有关系,go_package代表的是import_path:  2. grpc.pb.go和pb.go里的package是一致的,原因在于protoc执行后它们在同一目录下,grpc.pb.go的package取值服从pb.go 3. triple.go和pb.go并不在同一个目录,protoc执行后它们呈现如下目录结构,其中package为proto中指定的package,go_package由option指定: -<go_package>triple -<package>.triple.go -<package>.pb.go 此时triple.go和pb.go并不在同一个目录,为了便于理解和调用,将triple.go里的package设置为<go_package>triple。那么用户使用结构体时直接利用<go_package>.struct进行引用,使用生成的client和server时利用<go_package>triple.func进行引用,两者不会冲突。 刘军:这里的 GreetServiceName 那?我看GreetServiceName是决定了最终我们发布的服务路径,应该是greettriple.GreetService还是greet.GreetService 唐启文-大三:发布出去的是greet.GreetService 刘军:@唐启文 那应该没毛病了 王宇轩:greet.GreetService中的greet就是proto里的package,用于命名空间的划分。greettriple只是用于go import的package名,其实叫什么都无所谓,我们叫greettriple方便用户使用 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
