break generator when happen error (#192)

Co-authored-by: kim <xutao@xiaoheiban.cn>
This commit is contained in:
kingxt
2020-11-07 21:25:52 +08:00
committed by GitHub
parent 57079bf4a4
commit 12327fa07d
8 changed files with 18 additions and 11 deletions

View File

@@ -72,8 +72,9 @@ func genMain(dir string, api *spec.ApiSpec) error {
"serviceName": api.Service.Name,
})
if err != nil {
return nil
return err
}
formatCode := formatCode(buffer.String())
_, err = fp.WriteString(formatCode)
return err