Commit d6cada7f authored by Naoki Kanatani's avatar Naoki Kanatani Committed by Tom Bergan

net/http: delete unnecessary string concatenation

In the existing implementation, if pattern is an empty string,
program calls a panic with the message which is a concatenation of
"http: invalid pattern " and pattern.
In this case, pattern is an empty, so the commit removes
this concatenation and the trailing space.

Fixes: #21102

Change-Id: I49f58b52d835311a6ac642de871eb15646e48a54
Reviewed-on: https://go-review.googlesource.com/50350Reviewed-by: default avatarDmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: default avatarTom Bergan <tombergan@google.com>
Run-TryBot: Tom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a1371756
......@@ -2265,7 +2265,7 @@ func (mux *ServeMux) Handle(pattern string, handler Handler) {
defer mux.mu.Unlock()
if pattern == "" {
panic("http: invalid pattern " + pattern)
panic("http: invalid pattern")
}
if handler == nil {
panic("http: nil handler")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment