dont tag if tag_path is empty

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-05-11 09:07:12 +03:00
parent 9ed1ca9a89
commit 5ecc4986dd
2 changed files with 4 additions and 1 deletions

3
ast.go
View File

@ -20,6 +20,9 @@ var (
) )
func (g *Generator) astGenerate(plugin *protogen.Plugin) error { func (g *Generator) astGenerate(plugin *protogen.Plugin) error {
if g.tagPath == "" {
return nil
}
for _, file := range plugin.Files { for _, file := range plugin.Files {
if !file.Generate { if !file.Generate {
continue continue

View File

@ -13,7 +13,7 @@ var (
flagDebug = flag.Bool("debug", false, "") flagDebug = flag.Bool("debug", false, "")
flagStandalone = flag.Bool("standalone", false, "") flagStandalone = flag.Bool("standalone", false, "")
flagComponents = flag.String("components", "micro|rpc|http|client|server", "") flagComponents = flag.String("components", "micro|rpc|http|client|server", "")
flagTagPath = flag.String("tag_path", ".", "") flagTagPath = flag.String("tag_path", "", "")
) )
func main() { func main() {