Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckCanonicalHeaderKey / CheckCanonicalHeaderKey.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckCanonicalHeaderKey/CheckCanonicalHeaderKey.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckCanonicalHeaderKey/CheckCanonicalHeaderKey.go
new file mode 100644 (file)
index 0000000..8f4bffe
--- /dev/null
@@ -0,0 +1,14 @@
+package pkg
+
+import "net/http"
+
+func fn() {
+       var r http.Request
+       h := http.Header{}
+       var m map[string][]string
+       _ = h["foo"] // want `keys in http\.Header are canonicalized`
+       h["foo"] = nil
+       _ = r.Header["foo"] // want `keys in http\.Header are canonicalized`
+       r.Header["foo"] = nil
+       _ = m["foo"]
+}