Skip to content

Commit

Permalink
refactor(telegram): use invoker for argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed May 28, 2021
1 parent 27f566d commit 2addfad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions telegram/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ type MiddlewareFunc func(next tg.Invoker) InvokeFunc
// Handle implements Middleware.
func (m MiddlewareFunc) Handle(next tg.Invoker) InvokeFunc { return m(next) }

func chainMiddlewares(client tg.Invoker, chain ...Middleware) tg.Invoker {
func chainMiddlewares(invoker tg.Invoker, chain ...Middleware) tg.Invoker {
if len(chain) == 0 {
return client
return invoker
}
for i := len(chain) - 1; i >= 0; i-- {
client = chain[i].Handle(client)
invoker = chain[i].Handle(invoker)
}
return client
return invoker
}

0 comments on commit 2addfad

Please sign in to comment.