github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/staticcheck/testdata/CheckCanonicalHeaderKey.go (about)

     1  package pkg
     2  
     3  import "net/http"
     4  
     5  func fn() {
     6  	var r http.Request
     7  	h := http.Header{}
     8  	var m map[string][]string
     9  	_ = h["foo"] // MATCH /keys in http.Header are canonicalized/
    10  	h["foo"] = nil
    11  	_ = r.Header["foo"] // MATCH /keys in http.Header are canonicalized/
    12  	r.Header["foo"] = nil
    13  	_ = m["foo"]
    14  }