mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 15:22:18 +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) {
|
func (mux *ServeMux) Use(mws ...MiddlewareFunc) {
|
||||||
mux.mu.Lock()
|
mux.mu.Lock()
|
||||||
defer mux.mu.Unlock()
|
defer mux.mu.Unlock()
|
||||||
for _, fn := range mws {
|
mux.mws = append(mux.mws, mws...)
|
||||||
mux.mws = append(mux.mws, fn)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotFound returns an error indicating that the handler was not found for the given task.
|
// NotFound returns an error indicating that the handler was not found for the given task.
|
||||||
|
Loading…
Reference in New Issue
Block a user