fix return in for (#367)
Co-authored-by: HarryWang29 <wrz890829@gmail.com>
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user