aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/server.go
diff options
context:
space:
mode:
authorNaoki Kanatani <k12naoki@gmail.com>2017-07-21 00:35:31 +0900
committerTom Bergan <tombergan@google.com>2017-08-15 23:29:17 +0000
commitd6cada7fa4ef92190c2b59c9048413f9280e4a74 (patch)
treee5eb6f0c9039a3c41bf813f29de0a6c061dd8cf9 /src/net/http/server.go
parenta1371756c368e4d85cfb84ac8ffc53180aa4d2f2 (diff)
downloadgo-d6cada7fa4ef92190c2b59c9048413f9280e4a74.tar.xz
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/50350 Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com> Reviewed-by: Tom Bergan <tombergan@google.com> Run-TryBot: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/net/http/server.go')
-rw-r--r--src/net/http/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index e5ac252a68..8af4438262 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -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")