fallback to generate client and server

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-03-30 18:30:58 +03:00
parent be4eac21df
commit f69088bd27

View File

@ -48,6 +48,12 @@ func (g *Generator) Generate(plugin *protogen.Plugin) error {
if strings.Contains(g.components, "client") {
genClient = true
}
if strings.Contains(g.components, "rpc") || strings.Contains(g.components, "http") {
if !genServer && !genClient {
genServer = true
genClient = true
}
}
// Protoc passes a slice of File structs for us to process
for _, component := range strings.Split(g.components, "|") {