Use contants from http package.

This commit is contained in:
Ludovic Fernandez 2017-11-20 09:40:03 +01:00 committed by Traefiker
parent 7ed4ae2f8c
commit 05a9350e57
16 changed files with 68 additions and 62 deletions

View file

@ -32,7 +32,7 @@ var (
// AddRoutes add version routes on a router
func (v Handler) AddRoutes(router *mux.Router) {
router.Methods("GET").Path("/api/version").
router.Methods(http.MethodGet).Path("/api/version").
HandlerFunc(func(response http.ResponseWriter, request *http.Request) {
v := struct {
Version string
@ -63,7 +63,7 @@ func CheckNewVersion() {
return
}
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
log.Warnf("Error checking new version: status=%s", resp.Status)
return
}