Skip to content

Commit a990796

Browse files
authored
fix(tool): skip pb code gen for arg -use (cloudwego#1819)
1 parent b3a437e commit a990796

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tool/internal_pkg/prutal/prutal.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ func (pg *PrutalGen) initPackageInfo(f *prutalgen.Proto) *generator.PackageInfo
5757
}
5858

5959
func (pg *PrutalGen) generateClientServerFiles(f *prutalgen.Proto, p *generator.PackageInfo) error {
60-
if pg.c.Use != "" {
61-
return nil
62-
}
6360
log.Debugf("[INFO] Generate %q at %q\n", f.ProtoFile, f.GoImport)
6461
for _, s := range p.Services {
6562
p.ServiceInfo = s
@@ -102,6 +99,10 @@ func (pg *PrutalGen) Process() error {
10299
p := pg.initPackageInfo(f)
103100
pg.pp = append(pg.pp, p)
104101

102+
if pg.c.Use != "" {
103+
continue
104+
}
105+
105106
// generate the structs and interfaces
106107
genStructsAndKitexInterfaces(f, c, srcPath)
107108
if err := pg.generateClientServerFiles(f, p); err != nil {

0 commit comments

Comments
 (0)