fix(backend): fix problems found by new linters

This commit is contained in:
Łukasz Mierzwa
2019-08-18 15:51:54 +01:00
parent 0de532a84c
commit 77735ffcf1
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -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 {
+2 -2
View File
@@ -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"`
+2 -2
View File
@@ -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)
}
}
}
+1 -1
View File
@@ -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
View File
@@ -324,7 +324,7 @@ var acTests = []acTestCase{
"job!=node_exporter",
},
},
// duplicated to test reponse caching
// duplicated to test response caching
{
Term: "Nod",
Results: []string{