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 / stylecheck / testdata / src / CheckHTTPStatusCodes / CheckHTTPStatusCodes.go
1 // Package pkg ...
2 package pkg
3
4 import "net/http"
5
6 func fn() {
7         // Check all the supported functions
8         http.Error(nil, "", 506)         // want `http\.StatusVariantAlsoNegotiates`
9         http.Redirect(nil, nil, "", 506) // want `http\.StatusVariantAlsoNegotiates`
10         http.StatusText(506)             // want `http\.StatusVariantAlsoNegotiates`
11         http.RedirectHandler("", 506)    // want `http\.StatusVariantAlsoNegotiates`
12
13         // Don't flag literals with no known constant
14         http.StatusText(600)
15
16         // Don't flag constants
17         http.StatusText(http.StatusAccepted)
18
19         // Don't flag items on the whitelist (well known codes)
20         http.StatusText(404)
21 }