mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
fix(backend): fix problems found by new linters
This commit is contained in:
@@ -194,7 +194,7 @@ func (am *Alertmanager) pullSilences(version string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// PublicURI is the URI of this Alertmanager we put in JSON reponse
|
||||
// PublicURI is the URI of this Alertmanager we put in JSON response
|
||||
// it's either real full URI or a proxy relative URI
|
||||
func (am *Alertmanager) PublicURI() string {
|
||||
if am.ProxyRequests {
|
||||
|
||||
@@ -37,7 +37,7 @@ type LabelColors struct {
|
||||
// LabelsColorMap is a map of "Label Key" -> "Label Value" -> karmaLabelColors
|
||||
type LabelsColorMap map[string]map[string]LabelColors
|
||||
|
||||
// LabelsCountMap is a map of "Label Key" -> "Label Value" -> number of occurence
|
||||
// LabelsCountMap is a map of "Label Key" -> "Label Value" -> number of occurrence
|
||||
type LabelsCountMap map[string]map[string]int
|
||||
|
||||
type LabelValueStats struct {
|
||||
@@ -304,7 +304,7 @@ type AlertsResponse struct {
|
||||
}
|
||||
|
||||
// Autocomplete is the structure of autocomplete object for filter hints
|
||||
// this is internal represenation, not what's returned to the user
|
||||
// this is internal representation, not what's returned to the user
|
||||
type Autocomplete struct {
|
||||
Value string `json:"value"`
|
||||
Tokens []string `json:"tokens"`
|
||||
|
||||
@@ -149,7 +149,7 @@ func TestHTTPReader(t *testing.T) {
|
||||
}
|
||||
|
||||
if got != int64(len(responseBody)+1) {
|
||||
t.Errorf("[%v] Wrong respone size, got %d, expected %d", testCase, got, len(responseBody))
|
||||
t.Errorf("[%v] Wrong response size, got %d, expected %d", testCase, got, len(responseBody))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ func TestFileReader(t *testing.T) {
|
||||
}
|
||||
|
||||
if got != testCase.size {
|
||||
t.Errorf("[%v] Wrong respone size, got %d, expected %d", testCase, got, testCase.size)
|
||||
t.Errorf("[%v] Wrong response size, got %d, expected %d", testCase, got, testCase.size)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ func alerts(c *gin.Context) {
|
||||
start := time.Now()
|
||||
ts, _ := start.UTC().MarshalText()
|
||||
|
||||
// intialize response object, set fields that don't require any locking
|
||||
// initialize response object, set fields that don't require any locking
|
||||
resp := models.AlertsResponse{}
|
||||
resp.Status = "success"
|
||||
resp.Timestamp = string(ts)
|
||||
|
||||
+1
-1
@@ -324,7 +324,7 @@ var acTests = []acTestCase{
|
||||
"job!=node_exporter",
|
||||
},
|
||||
},
|
||||
// duplicated to test reponse caching
|
||||
// duplicated to test response caching
|
||||
{
|
||||
Term: "Nod",
|
||||
Results: []string{
|
||||
|
||||
Reference in New Issue
Block a user