diff --git a/pkg/api/cloudwatch/metrics.go b/pkg/api/cloudwatch/metrics.go index a7d5e528a4a..e63798c0d8f 100644 --- a/pkg/api/cloudwatch/metrics.go +++ b/pkg/api/cloudwatch/metrics.go @@ -166,9 +166,7 @@ func handleGetNamespaces(req *cwRequest, c *middleware.Context) { customNamespaces := req.DataSource.JsonData.Get("customMetricsNamespaces").MustString() if customNamespaces != "" { - for _, key := range strings.Split(customNamespaces, ",") { - keys = append(keys, key) - } + keys = append(keys, strings.Split(customNamespaces, ",")...) } sort.Sort(sort.StringSlice(keys)) diff --git a/pkg/components/dashdiffs/formatter_basic.go b/pkg/components/dashdiffs/formatter_basic.go index af93ff42bf2..4c8e03252a3 100644 --- a/pkg/components/dashdiffs/formatter_basic.go +++ b/pkg/components/dashdiffs/formatter_basic.go @@ -231,7 +231,7 @@ func (b *BasicDiff) Basic(lines []*JSONLine) []*BasicBlock { // in the JSON document to a top level key. // // In order to produce distinct "blocks" when rendering the basic diff, -// we need a way to distinguish between differnt sections of data. +// we need a way to distinguish between different sections of data. // To do this, we consider the value(s) of each top-level JSON key to // represent a distinct block for Grafana's JSON data structure, so // we perform this check to see if we've entered a new "block". If we diff --git a/pkg/components/dashdiffs/formatter_json.go b/pkg/components/dashdiffs/formatter_json.go index a2807b15992..3a9ddcc4ee3 100644 --- a/pkg/components/dashdiffs/formatter_json.go +++ b/pkg/components/dashdiffs/formatter_json.go @@ -302,16 +302,16 @@ func (f *JSONFormatter) processItem(value interface{}, deltas []diff.Delta, posi return nil } -func (f *JSONFormatter) searchDeltas(deltas []diff.Delta, postion diff.Position) (results []diff.Delta) { +func (f *JSONFormatter) searchDeltas(deltas []diff.Delta, position diff.Position) (results []diff.Delta) { results = make([]diff.Delta, 0) for _, delta := range deltas { switch delta.(type) { case diff.PostDelta: - if delta.(diff.PostDelta).PostPosition() == postion { + if delta.(diff.PostDelta).PostPosition() == position { results = append(results, delta) } case diff.PreDelta: - if delta.(diff.PreDelta).PrePosition() == postion { + if delta.(diff.PreDelta).PrePosition() == position { results = append(results, delta) } default: diff --git a/pkg/login/auth.go b/pkg/login/auth.go index a71837e25bc..45561783e43 100644 --- a/pkg/login/auth.go +++ b/pkg/login/auth.go @@ -33,8 +33,8 @@ func AuthenticateUser(query *LoginUserQuery) error { if setting.LdapEnabled { for _, server := range LdapCfg.Servers { - auther := NewLdapAuthenticator(server) - err = auther.Login(query) + author := NewLdapAuthenticator(server) + err = author.Login(query) if err == nil || err != ErrInvalidCredentials { return err } diff --git a/pkg/middleware/auth_proxy.go b/pkg/middleware/auth_proxy.go index 8e94e1582b0..3247805ec09 100644 --- a/pkg/middleware/auth_proxy.go +++ b/pkg/middleware/auth_proxy.go @@ -67,7 +67,7 @@ func initContextWithAuthProxy(ctx *Context, orgId int64) bool { if getRequestUserId(ctx) > 0 && getRequestUserId(ctx) != query.Result.UserId { // remove session if err := ctx.Session.Destory(ctx); err != nil { - log.Error(3, "Failed to destory session, err") + log.Error(3, "Failed to destroy session, err") } // initialize a new session @@ -107,8 +107,8 @@ var syncGrafanaUserWithLdapUser = func(ctx *Context, query *m.GetSignedInUserQue ldapCfg := login.LdapCfg for _, server := range ldapCfg.Servers { - auther := login.NewLdapAuthenticator(server) - if err := auther.SyncSignedInUser(query.Result); err != nil { + author := login.NewLdapAuthenticator(server) + if err := author.SyncSignedInUser(query.Result); err != nil { return err } } diff --git a/pkg/tsdb/mqe/types_test.go b/pkg/tsdb/mqe/types_test.go index fccd6709bd4..6f716937f1e 100644 --- a/pkg/tsdb/mqe/types_test.go +++ b/pkg/tsdb/mqe/types_test.go @@ -71,7 +71,7 @@ func TestWildcardExpansion(t *testing.T) { So(expandeQueries[0].RawQuery, ShouldEqual, fmt.Sprintf("`os.cpu.3.idle`|aggregate.min|aggregate.max where cluster in ('demoapp-1', 'demoapp-2') and host in ('staples-lab-1', 'staples-lab-2') from %v to %v", from, to)) }) - Convey("Containg wildcard series", func() { + Convey("Containing wildcard series", func() { query := &Query{ Metrics: []Metric{ {Metric: "os.cpu*", Alias: ""},