Added golangci-lint configuration and prepared for the integrattion

This commit is contained in:
Andrey Meshkov
2019-01-25 16:01:27 +03:00
committed by Eugene Bujak
parent 69a75fbcaa
commit ec6b1f7c42
13 changed files with 108 additions and 42 deletions

View File

@@ -39,7 +39,7 @@ func safeWriteFile(path string, data []byte) error {
func ensure(method string, handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
if r.Method != method {
http.Error(w, "This request must be "+method, 405)
http.Error(w, "This request must be "+method, http.StatusMethodNotAllowed)
return
}
handler(w, r)