Chore: Fix issues found by staticcheck (#28802)

* Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-11-05 11:29:39 +01:00
committed by GitHub
parent dff84f6a31
commit 574553ec7b
24 changed files with 67 additions and 64 deletions
+5 -2
View File
@@ -343,7 +343,7 @@ func (e *sqlQueryEndpoint) transformToTimeSeries(query *tsdb.Query, rows *core.R
}
if cfg.timeIndex == -1 {
return fmt.Errorf("Found no column named %s", strings.Join(e.timeColumnNames, " or "))
return fmt.Errorf("found no column named %q", strings.Join(e.timeColumnNames, " or "))
}
if cfg.fillMissing {
@@ -666,7 +666,10 @@ func ConvertSqlValueColumnToFloat(columnName string, columnValue interface{}) (n
case nil:
value.Valid = false
default:
return null.NewFloat(0, false), fmt.Errorf("Value column must have numeric datatype, column: %s type: %T value: %v", columnName, typedValue, typedValue)
return null.NewFloat(0, false), fmt.Errorf(
"value column must have numeric datatype, column: %s, type: %T, value: %v",
columnName, typedValue, typedValue,
)
}
return value, nil