Skip to content

Commit 388ab9a

Browse files
author
叱军超
committed
调整模板中导入库,保持原有格式
中文注释改为英文
1 parent 2b5f9be commit 388ab9a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tools/protoc-gen-go-triple/gen/generator/tripleTpl.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,13 @@ const ImportTpl = `
140140
141141
import (
142142
"context"
143-
"dubbo.apache.org/dubbo-go/v3"
144143
{{if .IsStream}}"net/http"{{end}}
145144
)
146145
146+
import (
147+
"dubbo.apache.org/dubbo-go/v3"
148+
)
149+
147150
`
148151

149152
const TotalTpl = `// This is a compile-time assertion to ensure that this generated file and the Triple package

tools/protoc-gen-go-triple/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func genTriple(plugin *protogen.Plugin) error {
8383
continue
8484
}
8585

86-
// 跳过无服务的proto文件
86+
// Skip proto files without services.
8787
if len(file.Proto.GetService()) == 0 {
8888
continue
8989
}
@@ -93,7 +93,7 @@ func genTriple(plugin *protogen.Plugin) error {
9393
// Extract the package name from the go_package option
9494
// Use the import path as parsed by protogen to avoid edge cases.
9595
g := plugin.NewGeneratedFile(filename, file.GoImportPath)
96-
// 导入dubbo基础库
96+
// import Dubbo's libraries
9797
g.QualifiedGoIdent(protogen.GoImportPath("dubbo.apache.org/dubbo-go/v3/client").Ident("client"))
9898
g.QualifiedGoIdent(protogen.GoImportPath("dubbo.apache.org/dubbo-go/v3/common").Ident("common"))
9999
g.QualifiedGoIdent(protogen.GoImportPath("dubbo.apache.org/dubbo-go/v3/common/constant").Ident("constant"))

0 commit comments

Comments
 (0)