Skip to content

Commit

Permalink
fix return in for (zeromicro#367)
Browse files Browse the repository at this point in the history
Co-authored-by: HarryWang29 <wrz890829@gmail.com>
  • Loading branch information
HarryWang29 and HarryWang29 authored Jan 8, 2021
1 parent 2854ca0 commit e3fcdbf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/goctl/api/gogen/genmiddleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func genMiddleware(dir string, cfg *config.Config, api *spec.ApiSpec) error {
return err
}
if !created {
return nil
continue
}
defer fp.Close()

Expand All @@ -64,7 +64,9 @@ func genMiddleware(dir string, cfg *config.Config, api *spec.ApiSpec) error {

formatCode := formatCode(buffer.String())
_, err = fp.WriteString(formatCode)
return err
if err != nil {
return err
}
}
return nil
}

0 comments on commit e3fcdbf

Please sign in to comment.