net/httpのソースコードから。の定義はhttp.Header
ですmap[string][]string
。右?
しかし、なぜgo run
以下のコードで、結果が得られます:
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))
}