allow to generate standalone code
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
7
chi.go
7
chi.go
@@ -23,7 +23,12 @@ func (g *Generator) chiGenerate(component string, plugin *protogen.Plugin) error
|
||||
|
||||
chiPackageFiles[file.GoPackageName] = struct{}{}
|
||||
gname := "micro" + "_" + component + ".pb.go"
|
||||
gfile := plugin.NewGeneratedFile(gname, file.GoImportPath)
|
||||
|
||||
path := file.GoImportPath
|
||||
if g.standalone {
|
||||
path = "."
|
||||
}
|
||||
gfile := plugin.NewGeneratedFile(gname, path)
|
||||
|
||||
gfile.P("// Code generated by protoc-gen-micro")
|
||||
gfile.P("package ", file.GoPackageName)
|
||||
|
||||
Reference in New Issue
Block a user