Alanxtl commented on code in PR #3052:
URL: https://github.com/apache/dubbo-go/pull/3052#discussion_r2450468599


##########
tools/protoc-gen-go-triple/main.go:
##########
@@ -75,17 +76,48 @@ func main() {
 }
 
 func genTriple(plugin *protogen.Plugin) error {
+       var errors []error
+
        for _, file := range plugin.Files {
                if !file.Generate {
                        continue
                }
-               tripleGo, err := generator.ProcessProtoFile(file.Proto)
-               if err != nil {
-                       return err
+
+               // 跳过无服务的proto文件
+               if len(file.Proto.GetService()) == 0 {
+                       continue
                }
+
                filename := file.GeneratedFilenamePrefix + ".triple.go"
+               // Use the same import path as the pb.go file to ensure they're 
in the same package
+               // Extract the package name from the go_package option
+               // Use the import path as parsed by protogen to avoid edge 
cases.
                g := plugin.NewGeneratedFile(filename, file.GoImportPath)
-               return generator.GenTripleFile(g, tripleGo)
+               // 导入dubbo基础库

Review Comment:
   use English



##########
tools/protoc-gen-go-triple/main.go:
##########
@@ -75,17 +76,48 @@ func main() {
 }
 
 func genTriple(plugin *protogen.Plugin) error {
+       var errors []error
+
        for _, file := range plugin.Files {
                if !file.Generate {
                        continue
                }
-               tripleGo, err := generator.ProcessProtoFile(file.Proto)
-               if err != nil {
-                       return err
+
+               // 跳过无服务的proto文件

Review Comment:
   use English



-- 
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]

Reply via email to