1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:20:22 -07:00

net/url: simplify value lookup

Change-Id: Ic998c189003d4dee758fca3b5ac954d5b54d3d36
Reviewed-on: https://go-review.googlesource.com/19764
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-05-26 15:41:42 -07:00
parent 1dbba1a2b7
commit 5fc43c94bf

View File

@ -709,8 +709,8 @@ func (v Values) Get(key string) string {
if v == nil {
return ""
}
vs, ok := v[key]
if !ok || len(vs) == 0 {
vs := v[key]
if len(vs) == 0 {
return ""
}
return vs[0]