From cd64ec8718e0fb82a945f212ac4f62ef1a878236 Mon Sep 17 00:00:00 2001 From: Todd Persen Date: Wed, 17 Apr 2019 13:30:22 -0700 Subject: [PATCH] Fix typos in miscellaneous packages --- .gitignore | 2 +- auth.go | 2 +- authorizer/secret.go | 2 +- cmd/influxd/launcher/launcher.go | 2 +- dashboard.go | 2 +- errors_test.go | 14 +++++++------- http/authentication_middleware.go | 2 +- http/query_handler.go | 2 +- http/query_test.go | 2 +- http/swagger.yml | 6 +++--- http/task_service_test.go | 6 +++--- http/variable_test.go | 4 ++-- inmem/dashboard.go | 2 +- kit/check/check.go | 4 ++-- kit/check/check_test.go | 2 +- models/points.go | 6 +++--- models/time.go | 2 +- pkg/encoding/simple8b/encoding.go | 4 ++-- pkg/estimator/hll/hll.go | 2 +- pkg/pointer/pointer.go | 2 +- prometheus/codec.go | 6 +++--- query/query.go | 6 +++--- storage/wal/wal.go | 2 +- task/backend/bolt/bolt.go | 2 +- task/backend/query_logreader.go | 2 +- task/mock/task_control_service.go | 2 +- task/servicetest/servicetest.go | 2 +- testing/label_service.go | 2 +- testing/session.go | 2 +- testing/user_resource_mapping_service.go | 2 +- testing/variable.go | 4 ++-- 31 files changed, 51 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index b27f34b960..21c078a280 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ vendor # binary databases influxd.bolt -# Project distirbution +# Project distribution /dist # Project binaries. diff --git a/auth.go b/auth.go index 983561e67f..296fac1be5 100644 --- a/auth.go +++ b/auth.go @@ -38,7 +38,7 @@ func (a *Authorization) Valid() error { for _, p := range a.Permissions { if p.Resource.OrgID != nil && *p.Resource.OrgID != a.OrgID { return &Error{ - Msg: fmt.Sprintf("permisson %s is not for org id %s", p, a.OrgID), + Msg: fmt.Sprintf("permission %s is not for org id %s", p, a.OrgID), Code: EInvalid, } } diff --git a/authorizer/secret.go b/authorizer/secret.go index 48e0f69b16..3014c8afbc 100644 --- a/authorizer/secret.go +++ b/authorizer/secret.go @@ -95,7 +95,7 @@ func (s *SecretService) PutSecret(ctx context.Context, orgID influxdb.ID, key st // PutSecrets checks to see if the authorizer on context has read and write access to the secret keys provided. func (s *SecretService) PutSecrets(ctx context.Context, orgID influxdb.ID, m map[string]string) error { - // PutSecrets operates on intersection betwen m and keys beloging to orgID. + // PutSecrets operates on intersection between m and keys beloging to orgID. // We need to have read access to those secrets since it deletes the secrets (within the intersection) that have not be overridden. if err := authorizeReadSecret(ctx, orgID); err != nil { return err diff --git a/cmd/influxd/launcher/launcher.go b/cmd/influxd/launcher/launcher.go index c65e8cd31a..40b80cf5d1 100644 --- a/cmd/influxd/launcher/launcher.go +++ b/cmd/influxd/launcher/launcher.go @@ -448,7 +448,7 @@ func (m *Launcher) run(ctx context.Context) (err error) { // https://www.vaultproject.io/docs/commands/index.html#environment-variables svc, err := vault.NewSecretService() if err != nil { - m.logger.Error("failed initalizing vault secret service", zap.Error(err)) + m.logger.Error("failed initializing vault secret service", zap.Error(err)) return err } secretSvc = svc diff --git a/dashboard.go b/dashboard.go index 073da1bb87..97f1bb3517 100644 --- a/dashboard.go +++ b/dashboard.go @@ -52,7 +52,7 @@ type DashboardService interface { // AddDashboardCell adds a cell to a dashboard. AddDashboardCell(ctx context.Context, id ID, c *Cell, opts AddDashboardCellOptions) error - // RemoveDashboardCell removes a dashbaord. + // RemoveDashboardCell removes a dashboard. RemoveDashboardCell(ctx context.Context, dashboardID, cellID ID) error // UpdateDashboardCell replaces the dashboard cell with the provided ID. diff --git a/errors_test.go b/errors_test.go index 577d9ef617..b642016996 100644 --- a/errors_test.go +++ b/errors_test.go @@ -84,9 +84,9 @@ func TestErrorMessage(t *testing.T) { want: "simple error", }, { - name: "embeded error", - err: &platform.Error{Err: &platform.Error{Msg: "embeded error"}}, - want: "embeded error", + name: "embedded error", + err: &platform.Error{Err: &platform.Error{Msg: "embedded error"}}, + want: "embedded error", }, { name: "default error", @@ -120,12 +120,12 @@ func TestErrorOp(t *testing.T) { want: "op1", }, { - name: "embeded error", + name: "embedded error", err: &platform.Error{Op: "op1", Err: &platform.Error{Code: platform.EInvalid}}, want: "op1", }, { - name: "embeded error without op in root level", + name: "embedded error without op in root level", err: &platform.Error{Err: &platform.Error{Code: platform.EInvalid, Op: "op2"}}, want: "op2", }, @@ -160,12 +160,12 @@ func TestErrorCode(t *testing.T) { want: platform.ENotFound, }, { - name: "embeded error", + name: "embedded error", err: &platform.Error{Code: platform.ENotFound, Err: &platform.Error{Code: platform.EInvalid}}, want: platform.ENotFound, }, { - name: "embeded error with root level code", + name: "embedded error with root level code", err: &platform.Error{Err: &platform.Error{Code: platform.EInvalid}}, want: platform.EInvalid, }, diff --git a/http/authentication_middleware.go b/http/authentication_middleware.go index 940ac84671..bcc0b03d73 100644 --- a/http/authentication_middleware.go +++ b/http/authentication_middleware.go @@ -20,7 +20,7 @@ type AuthenticationHandler struct { SessionService platform.SessionService // This is only really used for it's lookup method the specific http - // hanlder used to register routes does not matter. + // handler used to register routes does not matter. noAuthRouter *httprouter.Router Handler http.Handler diff --git a/http/query_handler.go b/http/query_handler.go index 774b733316..030bf4838f 100644 --- a/http/query_handler.go +++ b/http/query_handler.go @@ -264,7 +264,7 @@ func (h *FluxHandler) postFluxSpec(w http.ResponseWriter, r *http.Request) { } } -// fluxParams contain flux funciton parameters as defined by the semantic graph +// fluxParams contain flux function parameters as defined by the semantic graph type fluxParams map[string]string // suggestionResponse provides the parameters available for a given Flux function diff --git a/http/query_test.go b/http/query_test.go index 31346638bf..a634d67a99 100644 --- a/http/query_test.go +++ b/http/query_test.go @@ -433,7 +433,7 @@ func Test_decodeQueryRequest(t *testing.T) { }, }, { - name: "valid query request with explict content-type", + name: "valid query request with explicit content-type", args: args{ r: func() *http.Request { r := httptest.NewRequest("POST", "/", bytes.NewBufferString(`{"query": "from()"}`)) diff --git a/http/swagger.yml b/http/swagger.yml index 5169d27587..a26b90093c 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -14,7 +14,7 @@ paths: - $ref: '#/components/parameters/TraceSpan' responses: '204': - description: succesfully authenticated + description: successfully authenticated '401': description: unauthorized access content: @@ -3007,12 +3007,12 @@ paths: - application/vnd.flux - in: query name: org - description: specifies the name of the organization executing the query; if both orgID and org are specified, orgID takes precendence. + description: specifies the name of the organization executing the query; if both orgID and org are specified, orgID takes precedence. schema: type: string - in: query name: orgID - description: specifies the ID of the organization executing the query; if both orgID and org are specified, orgID takes precendence. + description: specifies the ID of the organization executing the query; if both orgID and org are specified, orgID takes precedence. schema: type: string requestBody: diff --git a/http/task_service_test.go b/http/task_service_test.go index 4a4ac72143..c32229783b 100644 --- a/http/task_service_test.go +++ b/http/task_service_test.go @@ -39,7 +39,7 @@ func NewMockTaskBackend(t *testing.T) *TaskBackend { FindOrganizationF: func(ctx context.Context, filter platform.OrganizationFilter) (*platform.Organization, error) { org := &platform.Organization{} if filter.Name != nil { - if *filter.Name == "non-existant-org" { + if *filter.Name == "non-existent-org" { return nil, &platform.Error{ Err: errors.New("org not found or unauthorized"), Msg: "org " + *filter.Name + " not found or unauthorized", @@ -329,7 +329,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) { }, { name: "get tasks by org name bad", - getParams: "org=non-existant-org", + getParams: "org=non-existent-org", fields: fields{ taskService: &mock.TaskService{ FindTasksFn: func(ctx context.Context, f platform.TaskFilter) ([]*platform.Task, int, error) { @@ -375,7 +375,7 @@ func TestTaskHandler_handleGetTasks(t *testing.T) { "error": { "code": "not found", "error": "org not found or unauthorized", -"message": "org non-existant-org not found or unauthorized" +"message": "org non-existent-org not found or unauthorized" }, "message": "failed to decode request" }`, diff --git a/http/variable_test.go b/http/variable_test.go index cd1ae9bcfd..4c6ca91b91 100644 --- a/http/variable_test.go +++ b/http/variable_test.go @@ -358,7 +358,7 @@ func TestVariableService_handleGetVariable(t *testing.T) { }, }, { - name: "get a non-existant variable", + name: "get a non-existent variable", args: args{ id: "75650d0a636f6d70", }, @@ -695,7 +695,7 @@ func TestVariableService_handleDeleteVariable(t *testing.T) { }, }, { - name: "delete a non-existant variable", + name: "delete a non-existent variable", fields: fields{ &mock.VariableService{ DeleteVariableF: func(ctx context.Context, id platform.ID) error { diff --git a/inmem/dashboard.go b/inmem/dashboard.go index 8ec93e8458..3e5a0991df 100644 --- a/inmem/dashboard.go +++ b/inmem/dashboard.go @@ -260,7 +260,7 @@ func (s *Service) createCellView(ctx context.Context, cell *platform.Cell) *plat return nil } -// PutDashboardCell replaces a dashboad cell with the cell contents. +// PutDashboardCell replaces a dashboard cell with the cell contents. func (s *Service) PutDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell) error { d, err := s.FindDashboardByID(ctx, id) if err != nil { diff --git a/kit/check/check.go b/kit/check/check.go index f2dba60153..79ae3d3720 100644 --- a/kit/check/check.go +++ b/kit/check/check.go @@ -83,7 +83,7 @@ func (c *Check) CheckHealth(ctx context.Context) Response { } overrideResponse := Response{ Name: "manual-override", - Message: "health manually overriden", + Message: "health manually overridden", } response.Checks = append(response.Checks, overrideResponse) } @@ -117,7 +117,7 @@ func (c *Check) CheckReady(ctx context.Context) Response { } // SetPassthrough allows you to set a handler to use if the request is not a ready or health check. -// This can be usefull if you intend to use this as a middleware. +// This can be useful if you intend to use this as a middleware. func (c *Check) SetPassthrough(h http.Handler) { c.passthroughHandler = h } diff --git a/kit/check/check_test.go b/kit/check/check_test.go index fb24289b54..610c914374 100644 --- a/kit/check/check_test.go +++ b/kit/check/check_test.go @@ -189,7 +189,7 @@ func TestForceHealth(t *testing.T) { Name: "Health", Status: "fail", Checks: Responses{ - Response{Name: "manual-override", Message: "health manually overriden"}, + Response{Name: "manual-override", Message: "health manually overridden"}, Response{Name: "a", Status: "pass"}, }, } diff --git a/models/points.go b/models/points.go index 5602611d8d..f4fe000505 100644 --- a/models/points.go +++ b/models/points.go @@ -147,7 +147,7 @@ type Point interface { // the result, potentially reducing string allocations. AppendString(buf []byte) []byte - // FieldIterator retuns a FieldIterator that can be used to traverse the + // FieldIterator returns a FieldIterator that can be used to traverse the // fields of a point without constructing the in-memory map. FieldIterator() FieldIterator } @@ -2266,7 +2266,7 @@ func DeepCopyTags(a Tags) Tags { // values. type Fields map[string]interface{} -// FieldIterator retuns a FieldIterator that can be used to traverse the +// FieldIterator returns a FieldIterator that can be used to traverse the // fields of a point without constructing the in-memory map. func (p *point) FieldIterator() FieldIterator { p.Reset() @@ -2387,7 +2387,7 @@ func (p *point) Reset() { } // MarshalBinary encodes all the fields to their proper type and returns the binary -// represenation +// representation // NOTE: uint64 is specifically not supported due to potential overflow when we decode // again later to an int64 // NOTE2: uint is accepted, and may be 64 bits, and is for some reason accepted... diff --git a/models/time.go b/models/time.go index e98f2cb336..297892c6da 100644 --- a/models/time.go +++ b/models/time.go @@ -10,7 +10,7 @@ import ( ) const ( - // MinNanoTime is the minumum time that can be represented. + // MinNanoTime is the minimum time that can be represented. // // 1677-09-21 00:12:43.145224194 +0000 UTC // diff --git a/pkg/encoding/simple8b/encoding.go b/pkg/encoding/simple8b/encoding.go index ec97ae2521..bfc51cd5b3 100644 --- a/pkg/encoding/simple8b/encoding.go +++ b/pkg/encoding/simple8b/encoding.go @@ -1,4 +1,4 @@ -// Package simple8b implements the 64bit integer encoding algoritm as published +// Package simple8b implements the 64bit integer encoding algorithm as published // by Ann and Moffat in "Index compression using 64-bit words", Softw. Pract. Exper. 2010; 40:131–147 // // It is capable of encoding multiple integers with values betweeen 0 and to 1^60 -1, in a single word. @@ -21,7 +21,7 @@ package simple8b // └──────────────┴─────────────────────────────────────────────────────────────┘ // // For example, when the number of values can be encoded using 4 bits, selected 5 is encoded in the -// 4 most significant bits followed by 15 values encoded used 4 bits each in the remaing 60 bits. +// 4 most significant bits followed by 15 values encoded used 4 bits each in the remaining 60 bits. import ( "encoding/binary" "errors" diff --git a/pkg/estimator/hll/hll.go b/pkg/estimator/hll/hll.go index babbe74340..81429010f0 100644 --- a/pkg/estimator/hll/hll.go +++ b/pkg/estimator/hll/hll.go @@ -64,7 +64,7 @@ type Plus struct { tmpSet set denseList []uint8 // The dense representation of the HLL. - sparseList *compressedList // values that can be stored in the sparse represenation. + sparseList *compressedList // values that can be stored in the sparse representation. } // NewPlus returns a new Plus with precision p. p must be between 4 and 18. diff --git a/pkg/pointer/pointer.go b/pkg/pointer/pointer.go index 51a6147b8b..8906169c3b 100644 --- a/pkg/pointer/pointer.go +++ b/pkg/pointer/pointer.go @@ -1,4 +1,4 @@ -// Package pointer provides utilities for pointer handling that aren't avaliable in go. +// Package pointer provides utilities for pointer handling that aren't available in go. // Feel free to add more pointerification functions for more types as you need them. package pointer diff --git a/prometheus/codec.go b/prometheus/codec.go index 0c096ada71..512ec14440 100644 --- a/prometheus/codec.go +++ b/prometheus/codec.go @@ -19,7 +19,7 @@ type Encoder interface { Encode(mfs []*dto.MetricFamily) ([]byte, error) } -// Expfmt is encodes metric familes into promtheus exposition format. +// Expfmt encodes metric families into prometheus exposition format. type Expfmt struct { Format expfmt.Format } @@ -64,7 +64,7 @@ func EncodeExpfmt(mfs []*dto.MetricFamily, opts ...expfmt.Format) ([]byte, error return buf.Bytes(), nil } -// JSON is encodes metric familes into JSON. +// JSON encodes metric families into JSON. type JSON struct{} // Encode encodes metrics JSON bytes. This not always works @@ -100,7 +100,7 @@ const ( nsPerMilliseconds = int64(time.Millisecond / time.Nanosecond) ) -// LineProtocol is encodes metric familes into influxdb lineprotocl. +// LineProtocol encodes metric families into influxdb line protocol. type LineProtocol struct{} // Encode encodes metrics into line protocol format bytes. diff --git a/query/query.go b/query/query.go index 7f8cb442b4..8780127a74 100644 --- a/query/query.go +++ b/query/query.go @@ -24,7 +24,7 @@ type IteratorOptions struct { // This can be VarRef or a Call. Expr influxql.Expr - // Auxilary tags or values to also retrieve for the point. + // Auxiliary tags or values to also retrieve for the point. Aux []influxql.VarRef // Data sources from which to receive data. This is only used for encoding @@ -489,12 +489,12 @@ var OpenAuthorizer = openAuthorizer{} // AuthorizeDatabase returns true to allow any operation on a database. func (a openAuthorizer) AuthorizeDatabase(influxql.Privilege, string) bool { return true } -// AuthorizeSeriesRead allows accesss to any series. +// AuthorizeSeriesRead allows access to any series. func (a openAuthorizer) AuthorizeSeriesRead(database string, measurement []byte, tags models.Tags) bool { return true } -// AuthorizeSeriesWrite allows accesss to any series. +// AuthorizeSeriesWrite allows access to any series. func (a openAuthorizer) AuthorizeSeriesWrite(database string, measurement []byte, tags models.Tags) bool { return true } diff --git a/storage/wal/wal.go b/storage/wal/wal.go index c70dbad23f..fc8fb33703 100644 --- a/storage/wal/wal.go +++ b/storage/wal/wal.go @@ -122,7 +122,7 @@ func NewWAL(path string) *WAL { path: path, enabled: true, - // these options should be overriden by any options in the config + // these options should be overridden by any options in the config SegmentSize: DefaultSegmentSize, closing: make(chan struct{}), syncWaiters: make(chan chan error, 1024), diff --git a/task/backend/bolt/bolt.go b/task/backend/bolt/bolt.go index eaa50bb0eb..7c922dac0a 100644 --- a/task/backend/bolt/bolt.go +++ b/task/backend/bolt/bolt.go @@ -657,7 +657,7 @@ func (s *Store) Close() error { return s.db.Close() } -// DeleteOrg syncronously deletes an org and all their tasks from a bolt store. +// DeleteOrg synchronously deletes an org and all their tasks from a bolt store. func (s *Store) DeleteOrg(ctx context.Context, id platform.ID) error { orgID, err := id.Encode() if err != nil { diff --git a/task/backend/query_logreader.go b/task/backend/query_logreader.go index 95dc031dea..851d3e7543 100644 --- a/task/backend/query_logreader.go +++ b/task/backend/query_logreader.go @@ -105,7 +105,7 @@ func (qlr *QueryLogReader) ListRuns(ctx context.Context, orgID platform.ID, runF // Because flux doesnt support piviting on a rowkey that might not exist we need first check if we can pivot with "requestedAt" // and if that fails we can fall back to pivot without "requestedAt" - // TODO(lh): After we transition to a seperation of transactional and analytical stores this can be simplified. + // TODO(lh): After we transition to a separation of transactional and analytical stores this can be simplified. pivotWithRequestedAt := `|> pivot(rowKey:["runID", "scheduledFor", "requestedAt"], columnKey: ["status"], valueColumn: "_time")` pivotWithOutRequestedAt := `|> pivot(rowKey:["runID", "scheduledFor"], columnKey: ["status"], valueColumn: "_time")` diff --git a/task/mock/task_control_service.go b/task/mock/task_control_service.go index 496f3c39d4..49ecff9c65 100644 --- a/task/mock/task_control_service.go +++ b/task/mock/task_control_service.go @@ -281,7 +281,7 @@ func (d *TaskControlService) AddRunLog(ctx context.Context, taskID, runID influx run := d.runs[taskID][runID] if run == nil { - panic("cannot add a log to a non existant run") + panic("cannot add a log to a non existent run") } run.Log = append(run.Log, influxdb.Log{Time: when.Format(time.RFC3339Nano), Message: log}) return nil diff --git a/task/servicetest/servicetest.go b/task/servicetest/servicetest.go index 3b11fce4a2..9a9471d03a 100644 --- a/task/servicetest/servicetest.go +++ b/task/servicetest/servicetest.go @@ -122,7 +122,7 @@ type TestCreds struct { Token string } -// Authorizer returns an authorizer for the credentails in the struct +// Authorizer returns an authorizer for the credentials in the struct func (tc TestCreds) Authorizer() influxdb.Authorizer { return &influxdb.Authorization{ ID: tc.AuthorizationID, diff --git a/testing/label_service.go b/testing/label_service.go index c99b6adf53..d1b0d9341f 100644 --- a/testing/label_service.go +++ b/testing/label_service.go @@ -573,7 +573,7 @@ func DeleteLabel( }, }, { - name: "deleting a non-existant label", + name: "deleting a non-existent label", fields: LabelFields{ Labels: []*influxdb.Label{ { diff --git a/testing/session.go b/testing/session.go index b23c6c46a0..f76a1edf5f 100644 --- a/testing/session.go +++ b/testing/session.go @@ -183,7 +183,7 @@ func FindSession( }, }, { - name: "look for not exising session", + name: "look for not existing session", args: args{ key: "abc123xyz", }, diff --git a/testing/user_resource_mapping_service.go b/testing/user_resource_mapping_service.go index 2e17dc05b5..131c52d9de 100644 --- a/testing/user_resource_mapping_service.go +++ b/testing/user_resource_mapping_service.go @@ -216,7 +216,7 @@ func DeleteUserResourceMapping( }, }, { - name: "deleting a non-existant user", + name: "deleting a non-existent user", fields: UserResourceFields{ UserResourceMappings: []*platform.UserResourceMapping{}, }, diff --git a/testing/variable.go b/testing/variable.go index 6b6b8aaf55..641a418166 100644 --- a/testing/variable.go +++ b/testing/variable.go @@ -275,7 +275,7 @@ func FindVariableByID(init func(VariableFields, *testing.T) (platform.VariableSe }, }, { - name: "finding a non-existant variable", + name: "finding a non-existent variable", fields: VariableFields{ Variables: []*platform.Variable{}, }, @@ -538,7 +538,7 @@ func UpdateVariable(init func(VariableFields, *testing.T) (platform.VariableServ }, }, { - name: "updating a non-existant variable fails", + name: "updating a non-existent variable fails", fields: VariableFields{ Variables: []*platform.Variable{}, },