Update netquery query handler to only use strftime when the given value is a number kind

This commit is contained in:
Patrick Pacher
2023-09-07 11:58:07 +02:00
parent d96f841bef
commit 4cd6823066
4 changed files with 25 additions and 7 deletions

View File

@@ -123,7 +123,7 @@ func encodeBasic() EncodeFunc {
val = val.Elem()
}
switch normalizeKind(kind) { //nolint:exhaustive
switch NormalizeKind(kind) { //nolint:exhaustive
case reflect.String,
reflect.Float64,
reflect.Bool,
@@ -156,7 +156,7 @@ func DatetimeEncoder(loc *time.Location) EncodeFunc {
val = reflect.Indirect(val)
}
normalizedKind := normalizeKind(valType.Kind())
normalizedKind := NormalizeKind(valType.Kind())
// we only care about "time.Time" here
var t time.Time