602be22bb31902fcabb2f25c81efdcc19e8de8ec
[dotfiles/.git] / 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 }