aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/header.go
diff options
context:
space:
mode:
authorVladimir Varankin <vladimir@varank.in>2018-09-22 22:49:45 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2018-09-23 06:53:10 +0000
commitfdefabadf0a2cb99accb2afe49eafce0eaeb53a7 (patch)
treeeda1a3434004f3978ac5ef975821379eb02f6a91 /src/net/http/header.go
parentce58a39fca067a19c505220c0c907ccf32793427 (diff)
downloadgo-fdefabadf0a2cb99accb2afe49eafce0eaeb53a7.tar.gz
go-fdefabadf0a2cb99accb2afe49eafce0eaeb53a7.zip
net/http: use Header.clone rather then duplicating functionality
cloneHeader duplicates what Header.clone() method is doing. It's used in a single place, which can be replaced with the use of the method. Change-Id: I6e8bbd6c95063f31ca3695f13fa7478873230525 GitHub-Last-Rev: eb08aeae9b4257df5cf08d6d30903ddeec6b6242 GitHub-Pull-Request: golang/go#27817 Reviewed-on: https://go-review.googlesource.com/136762 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/net/http/header.go')
-rw-r--r--src/net/http/header.go10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/net/http/header.go b/src/net/http/header.go
index b28144d8c1..2aa9d6254b 100644
--- a/src/net/http/header.go
+++ b/src/net/http/header.go
@@ -229,13 +229,3 @@ func hasToken(v, token string) bool {
func isTokenBoundary(b byte) bool {
return b == ' ' || b == ',' || b == '\t'
}
-
-func cloneHeader(h Header) Header {
- h2 := make(Header, len(h))
- for k, vv := range h {
- vv2 := make([]string, len(vv))
- copy(vv2, vv)
- h2[k] = vv2
- }
- return h2
-}