File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
tools/protoc-gen-go-triple Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,8 @@ func genTriple(plugin *protogen.Plugin) error {
9191 filename := file .GeneratedFilenamePrefix + ".triple.go"
9292 // Use the same import path as the pb.go file to ensure they're in the same package
9393 // Extract the package name from the go_package option
94- goPackage := file .Proto .Options .GetGoPackage ()
95- var importPath protogen.GoImportPath
96- if goPackage != "" {
97- parts := strings .Split (goPackage , ";" )
98- importPath = protogen .GoImportPath (parts [0 ])
99- } else {
100- importPath = file .GoImportPath
101- }
102- g := plugin .NewGeneratedFile (filename , importPath )
94+ // Use the import path as parsed by protogen to avoid edge cases.
95+ g := plugin .NewGeneratedFile (filename , file .GoImportPath )
10396 // 导入dubbo基础库
10497 g .QualifiedGoIdent (protogen .GoImportPath ("dubbo.apache.org/dubbo-go/v3/client" ).Ident ("client" ))
10598 g .QualifiedGoIdent (protogen .GoImportPath ("dubbo.apache.org/dubbo-go/v3/common" ).Ident ("common" ))
You can’t perform that action at this time.
0 commit comments