Skip to content

Commit

Permalink
optimize(hz): avoid insert point for handler by method (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
FGYFFFF authored Apr 26, 2023
1 parent ce158d4 commit 2800a9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/hz/generator/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func (pkgGen *HttpPackageGenerator) updateHandler(handler interface{}, handlerTp
if !isExist {
return pkgGen.TemplateGenerator.Generate(handler, handlerTpl, filePath, noRepeat)
}
if pkgGen.HandlerByMethod { // method by handler, do not need to insert new content
return nil
}

file, err := ioutil.ReadFile(filePath)
if err != nil {
Expand Down

0 comments on commit 2800a9b

Please sign in to comment.