From the source code of net/http. The definition of http.Header is map[string][]string. Right?
But why go run below code, I get the result:
0
2
func main() {
var header = make(http.Header)
header.Add("hello", "world")
header.Add("hello", "anotherworld")
var t = []string {"a", "b"}
fmt.Printf("%d\n", len(header["hello"]))
fmt.Print(len(t))
}
if you try
you’ll notice that the key has been capitalized. This is actually noted in the documentation of net/http.
This can be found in the comment on the field Header of type Request.
http://golang.org/pkg/net/http/#Request
Comment should probably be moved though..