fix possible linter screw-up in buildFlexiWhere

This commit is contained in:
Azareal 2020-03-05 11:01:23 +10:00
parent 1bee9a35f2
commit f5118d1b11

View File

@ -4,6 +4,8 @@ package qgen
import ( import (
"database/sql" "database/sql"
"errors" "errors"
//"fmt"
"os" "os"
"runtime" "runtime"
"strconv" "strconv"
@ -667,7 +669,10 @@ func (a *MysqlAdapter) buildFlexiWhere(where string, dateCutoff *dateCutoff) (q
switch dateCutoff.Type { switch dateCutoff.Type {
case 0: case 0:
sb.WriteString(" BETWEEN (UTC_TIMESTAMP() - interval ") sb.WriteString(" BETWEEN (UTC_TIMESTAMP() - interval ")
q += strconv.Itoa(dateCutoff.Quantity) + " " + dateCutoff.Unit + ") AND UTC_TIMESTAMP()" sb.WriteString(strconv.Itoa(dateCutoff.Quantity))
sb.WriteString(" ")
sb.WriteString(dateCutoff.Unit)
sb.WriteString(") AND UTC_TIMESTAMP()")
case 11: case 11:
sb.WriteString(" < UTC_TIMESTAMP() - interval ? ") sb.WriteString(" < UTC_TIMESTAMP() - interval ? ")
sb.WriteString(dateCutoff.Unit) sb.WriteString(dateCutoff.Unit)
@ -709,7 +714,6 @@ func (a *MysqlAdapter) buildFlexiWhere(where string, dateCutoff *dateCutoff) (q
} }
} }
} }
return sb.String(), nil return sb.String(), nil
} }