diff --git a/pkg/api/alerting.go b/pkg/api/alerting.go index 487d4ac9905..86a57e8e9a6 100644 --- a/pkg/api/alerting.go +++ b/pkg/api/alerting.go @@ -553,7 +553,7 @@ func (hs *HTTPServer) PauseAlert(c *models.ReqContext) response.Response { return response.Error(500, "", err) } - var resp models.AlertStateType = models.AlertStateUnknown + resp := models.AlertStateUnknown pausedState := "un-paused" if cmd.Paused { resp = models.AlertStatePaused @@ -579,7 +579,7 @@ func (hs *HTTPServer) PauseAllAlerts(c *models.ReqContext) response.Response { return response.Error(500, "Failed to pause alerts", err) } - var resp models.AlertStateType = models.AlertStatePending + resp := models.AlertStatePending pausedState := "un paused" if updateCmd.Paused { resp = models.AlertStatePaused diff --git a/pkg/services/contexthandler/contexthandler.go b/pkg/services/contexthandler/contexthandler.go index 407b89fa326..de9752c1fca 100644 --- a/pkg/services/contexthandler/contexthandler.go +++ b/pkg/services/contexthandler/contexthandler.go @@ -29,7 +29,8 @@ import ( const ( InvalidUsernamePassword = "invalid username or password" - InvalidAPIKey = "invalid API key" + /* #nosec */ + InvalidAPIKey = "invalid API key" ) const ServiceName = "ContextHandler" diff --git a/pkg/services/searchV2/extract/dashboard_test.go b/pkg/services/searchV2/extract/dashboard_test.go index 34270bec827..0bc3a17090b 100644 --- a/pkg/services/searchV2/extract/dashboard_test.go +++ b/pkg/services/searchV2/extract/dashboard_test.go @@ -49,7 +49,7 @@ func TestReadDashboard(t *testing.T) { require.NoError(t, err) update := false - savedPath := "testdata/" + input + "-info.json" + savedPath := filepath.Join("testdata/", input+"-info.json") saved, err := os.ReadFile(savedPath) if err != nil { update = true