Adjust error message, use TrimSpace for more robust empty typename check

This commit is contained in:
Luqqk
2021-08-02 01:23:58 +02:00
committed by Ken Hibino
parent 4bce28d677
commit 6817af366a
2 changed files with 6 additions and 5 deletions

View File

@@ -98,7 +98,7 @@ func (mux *ServeMux) Handle(pattern string, handler Handler) {
mux.mu.Lock()
defer mux.mu.Unlock()
if pattern == "" {
if strings.TrimSpace(pattern) == "" {
panic("asynq: invalid pattern")
}
if handler == nil {