Chore: Enable exhaustive linter (#29458)

* Chore: Enable exhaustive linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-01 09:53:27 +01:00
committed by GitHub
parent cbb2c0a5d8
commit f55818ca70
16 changed files with 37 additions and 16 deletions

View File

@@ -42,11 +42,9 @@ func (m *postgresMacroEngine) Interpolate(query *tsdb.Query, timeRange *tsdb.Tim
if groups[1] == "__timeGroup" {
if index := strings.Index(sql, groups[0]); index >= 0 {
index += len(groups[0])
if len(sql) > index {
// check for character after macro expression
if sql[index] == ',' {
groups[1] = "__timeGroupAlias"
}
// check for character after macro expression
if len(sql) > index && sql[index] == ',' {
groups[1] = "__timeGroupAlias"
}
}
}