Skip to content

Commit

Permalink
fix bug engine.HandleFunc() can handle only one HandleFunc
Browse files Browse the repository at this point in the history
  • Loading branch information
baytan0720 committed Oct 3, 2023
1 parent 41baa7d commit 0b546ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func (engine *Engine) Handle(funcName string, handler ...HandlerFunc) {
engine.handlers[funcName] = append(engine.handlers[funcName], handler...)
}

func (engine *Engine) HandleFunc(handler HandlerFunc) {
func (engine *Engine) HandleFunc(handler ...HandlerFunc) {
funcName := reflect.TypeOf(handler).Name()
engine.Handle(funcName, handler)
engine.Handle(funcName, handler...)
}

// Use registers a middleware for all rpc
Expand Down

0 comments on commit 0b546ac

Please # to comment.