mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 01:15:46 +08:00
Chore: a bit of spring cleaning (#16710)
* Chore: use early return technic everywhere And enable "indent-error-flow" revive rule * Chore: remove if-return rule from revive config * Chore: improve error messages And enable "error-strings" revive rule * Chore: enable "error-naming" revive rule * Chore: make linter happy * Chore: do not duplicate gofmt execution * Chore: make linter happy * Chore: address the pull review comments
This commit is contained in:
@ -108,9 +108,13 @@ func (m *postgresMacroEngine) evaluateMacro(name string, args []string) (string,
|
||||
|
||||
if m.timescaledb {
|
||||
return fmt.Sprintf("time_bucket('%vs',%s)", interval.Seconds(), args[0]), nil
|
||||
} else {
|
||||
return fmt.Sprintf("floor(extract(epoch from %s)/%v)*%v", args[0], interval.Seconds(), interval.Seconds()), nil
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
"floor(extract(epoch from %s)/%v)*%v", args[0],
|
||||
interval.Seconds(),
|
||||
interval.Seconds(),
|
||||
), nil
|
||||
case "__timeGroupAlias":
|
||||
tg, err := m.evaluateMacro("__timeGroup", args)
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user