Skip to content

Commit b87c8c3

Browse files
mateusz834gopherbot
authored andcommitted
net/url: simplify values Get
Checking if v == nil is unnecessary, nil map always return the zero value of the value type. Change-Id: I9c5499bc7db72c4c62e02013ba7f9a6ee4795c09 GitHub-Last-Rev: 03fc233 GitHub-Pull-Request: #58662 Reviewed-on: https://go-review.googlesource.com/c/go/+/470736 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Than McIntosh <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent ddb423a commit b87c8c3

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/net/url/url.go

-3
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,6 @@ type Values map[string][]string
883883
// the empty string. To access multiple values, use the map
884884
// directly.
885885
func (v Values) Get(key string) string {
886-
if v == nil {
887-
return ""
888-
}
889886
vs := v[key]
890887
if len(vs) == 0 {
891888
return ""

0 commit comments

Comments
 (0)