mirror of
https://github.com/hibiken/asynq.git
synced 2024-11-10 03:21:55 +08:00
chore: replace loop with mux.mws = append(mux.mws, mws...)
This commit is contained in:
parent
5bef53d1ac
commit
123d560a44
@ -144,9 +144,7 @@ func (mux *ServeMux) HandleFunc(pattern string, handler func(context.Context, *T
|
||||
func (mux *ServeMux) Use(mws ...MiddlewareFunc) {
|
||||
mux.mu.Lock()
|
||||
defer mux.mu.Unlock()
|
||||
for _, fn := range mws {
|
||||
mux.mws = append(mux.mws, fn)
|
||||
}
|
||||
mux.mws = append(mux.mws, mws...)
|
||||
}
|
||||
|
||||
// NotFound returns an error indicating that the handler was not found for the given task.
|
||||
|
Loading…
Reference in New Issue
Block a user