From 186e0392ed3cefad5890da16719ad2c5fe5adab2 Mon Sep 17 00:00:00 2001 From: Edd Robinson Date: Thu, 29 Nov 2018 17:22:49 +0000 Subject: [PATCH] Address PR feedback --- chronograf/enterprise/meta_test.go | 4 ++-- http/influxdb/source_proxy_query_service.go | 2 +- models/points.go | 4 ++-- task/backend/bolt/bolt.go | 8 ++++---- task/backend/inmem_store.go | 6 +++--- tsdb/tsm1/wal.go | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/chronograf/enterprise/meta_test.go b/chronograf/enterprise/meta_test.go index 3974ba8b55..8021d3d21c 100644 --- a/chronograf/enterprise/meta_test.go +++ b/chronograf/enterprise/meta_test.go @@ -1338,10 +1338,10 @@ func NewMockClient(code int, body []byte, headers http.Header, err error) *MockC func (c *MockClient) Do(URL *url.URL, path, method string, authorizer influx.Authorizer, params map[string]string, body io.Reader) (*http.Response, error) { if c == nil { - return nil, fmt.Errorf("nIL MockClient") + return nil, fmt.Errorf("nil MockClient") } if URL == nil { - return nil, fmt.Errorf("nIL url") + return nil, fmt.Errorf("nil url") } if c.Err != nil { return nil, c.Err diff --git a/http/influxdb/source_proxy_query_service.go b/http/influxdb/source_proxy_query_service.go index 930e6cb158..6269d6ad62 100644 --- a/http/influxdb/source_proxy_query_service.go +++ b/http/influxdb/source_proxy_query_service.go @@ -102,7 +102,7 @@ func (s *SourceProxyQueryService) fluxQuery(ctx context.Context, w io.Writer, re func (s *SourceProxyQueryService) influxQuery(ctx context.Context, w io.Writer, req *query.ProxyRequest) (int64, error) { if len(s.URL) == 0 { - return 0, fmt.Errorf("uRL from source cannot be empty if the compiler type is influxql") + return 0, fmt.Errorf("URL from source cannot be empty if the compiler type is influxql") } u, err := newURL(s.URL, "/query") diff --git a/models/points.go b/models/points.go index a9c22ee814..8e7f818f6e 100644 --- a/models/points.go +++ b/models/points.go @@ -1378,7 +1378,7 @@ func pointKey(measurement string, tags Tags, fields Fields, t time.Time) ([]byte return nil, fmt.Errorf("+/-Inf is an unsupported value for field %s", key) } if math.IsNaN(value) { - return nil, fmt.Errorf("naN is an unsupported value for field %s", key) + return nil, fmt.Errorf("NAN is an unsupported value for field %s", key) } case float32: // Ensure the caller validates and handles invalid field values @@ -1386,7 +1386,7 @@ func pointKey(measurement string, tags Tags, fields Fields, t time.Time) ([]byte return nil, fmt.Errorf("+/-Inf is an unsupported value for field %s", key) } if math.IsNaN(float64(value)) { - return nil, fmt.Errorf("naN is an unsupported value for field %s", key) + return nil, fmt.Errorf("NAN is an unsupported value for field %s", key) } } if len(key) == 0 { diff --git a/task/backend/bolt/bolt.go b/task/backend/bolt/bolt.go index f0fa3e06b1..711b2ea147 100644 --- a/task/backend/bolt/bolt.go +++ b/task/backend/bolt/bolt.go @@ -35,7 +35,7 @@ var ErrDBReadOnly = errors.New("db is read only") // ErrMaxConcurrency is an error for when the max concurrency is already // reached for a task when you try to schedule a task. -var ErrMaxConcurrency = errors.New("maxConcurrency reached") +var ErrMaxConcurrency = errors.New("max concurrency reached") // ErrRunNotFound is an error for when a run isn't found in a FinishRun method. var ErrRunNotFound = errors.New("run not found") @@ -280,7 +280,7 @@ func (s *Store) UpdateTask(ctx context.Context, req backend.UpdateTaskRequest) ( // ListTasks lists the tasks based on a filter. func (s *Store) ListTasks(ctx context.Context, params backend.TaskSearchParams) ([]backend.StoreTaskWithMeta, error) { if params.Org.Valid() && params.User.Valid() { - return nil, errors.New("listTasks: org and user filters are mutually exclusive") + return nil, errors.New("ListTasks: org and user filters are mutually exclusive") } const ( @@ -288,10 +288,10 @@ func (s *Store) ListTasks(ctx context.Context, params backend.TaskSearchParams) maxPageSize = 500 ) if params.PageSize < 0 { - return nil, errors.New("listTasks: PageSize must be positive") + return nil, errors.New("ListTasks: PageSize must be positive") } if params.PageSize > maxPageSize { - return nil, fmt.Errorf("listTasks: PageSize exceeds maximum of %d", maxPageSize) + return nil, fmt.Errorf("ListTasks: PageSize exceeds maximum of %d", maxPageSize) } lim := params.PageSize if lim == 0 { diff --git a/task/backend/inmem_store.go b/task/backend/inmem_store.go index bb6b9aa61f..924f83e46b 100644 --- a/task/backend/inmem_store.go +++ b/task/backend/inmem_store.go @@ -131,7 +131,7 @@ func (s *inmem) UpdateTask(_ context.Context, req UpdateTaskRequest) (UpdateTask func (s *inmem) ListTasks(_ context.Context, params TaskSearchParams) ([]StoreTaskWithMeta, error) { if params.Org.Valid() && params.User.Valid() { - return nil, errors.New("listTasks: org and user filters are mutually exclusive") + return nil, errors.New("ListTasks: org and user filters are mutually exclusive") } const ( @@ -140,10 +140,10 @@ func (s *inmem) ListTasks(_ context.Context, params TaskSearchParams) ([]StoreTa ) if params.PageSize < 0 { - return nil, errors.New("listTasks: PageSize must be positive") + return nil, errors.New("ListTasks: PageSize must be positive") } if params.PageSize > maxPageSize { - return nil, fmt.Errorf("listTasks: PageSize exceeds maximum of %d", maxPageSize) + return nil, fmt.Errorf("ListTasks: PageSize exceeds maximum of %d", maxPageSize) } lim := params.PageSize diff --git a/tsdb/tsm1/wal.go b/tsdb/tsm1/wal.go index f9d7162d58..7d0ae9c7fc 100644 --- a/tsdb/tsm1/wal.go +++ b/tsdb/tsm1/wal.go @@ -77,7 +77,7 @@ const ( var ( // ErrWALClosed is returned when attempting to write to a closed WAL file. - ErrWALClosed = fmt.Errorf("wAL closed") + ErrWALClosed = fmt.Errorf("WAL closed") // ErrWALCorrupt is returned when reading a corrupt WAL entry. ErrWALCorrupt = fmt.Errorf("corrupted WAL entry")