Codestyle: Fix some goconst issues (#17530)

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
This commit is contained in:
Mario Trangoni
2019-06-12 07:27:47 +02:00
committed by Carl Bergquist
parent 39e23ba672
commit ab4e1526b3
3 changed files with 14 additions and 7 deletions
+1 -1
View File
@@ -258,7 +258,7 @@ func (hs *HTTPServer) metricsEndpoint(ctx *macaron.Context) {
return
}
if ctx.Req.Method != "GET" || ctx.Req.URL.Path != "/metrics" {
if ctx.Req.Method != http.MethodGet || ctx.Req.URL.Path != "/metrics" {
return
}
+3 -1
View File
@@ -1,6 +1,8 @@
package api
import (
"net/http"
"github.com/grafana/grafana/pkg/bus"
_ "github.com/grafana/grafana/pkg/infra/log"
m "github.com/grafana/grafana/pkg/models"
@@ -33,7 +35,7 @@ func ValidateOrgPlaylist(c *m.ReqContext) {
return
}
if len(items) == 0 && c.Context.Req.Method != "DELETE" {
if len(items) == 0 && c.Context.Req.Method != http.MethodDelete {
c.JsonApiErr(404, "Playlist is empty", itemsErr)
return
}