1
0
mirror of https://github.com/kataras/iris.git synced 2026-06-09 23:23:35 +00:00

fix https://github.com/kataras/iris/issues/1713 and add a simple usage example of the 'RemoveHandler'

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-27 01:22:20 +02:00
parent 197df1ef64
commit f7757c0793
7 changed files with 60 additions and 34 deletions
+1 -1
View File
@@ -1210,7 +1210,7 @@ func (api *APIBuilder) RemoveHandler(namesOrHandlers ...interface{}) Party {
switch h := nameOrHandler.(type) {
case string:
handlerName = h
case context.Handler:
case context.Handler, func(*context.Context):
handlerName = context.HandlerName(h)
case *int:
counter = h
+1 -1
View File
@@ -159,7 +159,7 @@ func (r *Route) RemoveHandler(namesOrHandlers ...interface{}) (count int) {
switch h := nameOrHandler.(type) {
case string:
handlerName = h
case context.Handler:
case context.Handler, func(*context.Context):
handlerName = context.HandlerName(h)
default:
panic(fmt.Sprintf("remove handler: unexpected type of %T", h))