From 77735ffcf12dd1123efe9c9caaffd59475a6c65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 18 Aug 2019 15:51:54 +0100 Subject: [PATCH] fix(backend): fix problems found by new linters --- internal/alertmanager/models.go | 2 +- internal/models/api.go | 4 ++-- internal/uri/uri_test.go | 4 ++-- views.go | 2 +- views_test.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/alertmanager/models.go b/internal/alertmanager/models.go index d4306f883..02edae957 100644 --- a/internal/alertmanager/models.go +++ b/internal/alertmanager/models.go @@ -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 { diff --git a/internal/models/api.go b/internal/models/api.go index f6a9f7b40..f08d36768 100644 --- a/internal/models/api.go +++ b/internal/models/api.go @@ -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"` diff --git a/internal/uri/uri_test.go b/internal/uri/uri_test.go index 25ef4adf2..a7badba37 100644 --- a/internal/uri/uri_test.go +++ b/internal/uri/uri_test.go @@ -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) } } } diff --git a/views.go b/views.go index d0b22d56c..3dfa984ed 100644 --- a/views.go +++ b/views.go @@ -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) diff --git a/views_test.go b/views_test.go index 161257ace..31500a324 100644 --- a/views_test.go +++ b/views_test.go @@ -324,7 +324,7 @@ var acTests = []acTestCase{ "job!=node_exporter", }, }, - // duplicated to test reponse caching + // duplicated to test response caching { Term: "Nod", Results: []string{