Use contants from http package.
This commit is contained in:
parent
7ed4ae2f8c
commit
05a9350e57
16 changed files with 68 additions and 62 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue