Chore: Enable gocyclo linter (#26395)

* Chore: Enable gocyclo linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* API: Fix linting issue

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* API: Refactor to reduce complexity

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix type assertion

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-09-07 22:10:06 +02:00
committed by GitHub
parent fb1f2746aa
commit 4b1eb6e5c7
8 changed files with 289 additions and 225 deletions
@@ -17,6 +17,7 @@ type queryReducer struct {
Type string
}
//nolint: gocyclo
func (s *queryReducer) Reduce(series *tsdb.TimeSeries) null.Float {
if len(series.Points) == 0 {
return null.FloatFromPtr(nil)