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
", len(header["hello"]))
fmt.Print(len(t))
}