fix return in for (#367)

Co-authored-by: HarryWang29 <wrz890829@gmail.com>
master
HarryWang29 4 years ago committed by GitHub
parent 2854ca03b4
commit e3fcdbf040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,7 +48,7 @@ func genMiddleware(dir string, cfg *config.Config, api *spec.ApiSpec) error {
return err return err
} }
if !created { if !created {
return nil continue
} }
defer fp.Close() defer fp.Close()
@ -64,7 +64,9 @@ func genMiddleware(dir string, cfg *config.Config, api *spec.ApiSpec) error {
formatCode := formatCode(buffer.String()) formatCode := formatCode(buffer.String())
_, err = fp.WriteString(formatCode) _, err = fp.WriteString(formatCode)
return err if err != nil {
return err
}
} }
return nil return nil
} }

Loading…
Cancel
Save