app/vlinsert/loki: fix build for architectures where int is 32-bit

This commit is contained in:
Aliaksandr Valialkin 2023-07-20 21:00:58 -07:00
parent 9e6cc3c495
commit 8c59813c17
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -176,10 +176,10 @@ func parseLokiTimestamp(s string) (int64, error) {
return 0, err return 0, err
} }
if f > math.MaxInt64 { if f > math.MaxInt64 {
return 0, fmt.Errorf("too big timestamp in nanoseconds: %v; mustn't exceed %v", f, math.MaxInt64) return 0, fmt.Errorf("too big timestamp in nanoseconds: %v; mustn't exceed %v", f, int64(math.MaxInt64))
} }
if f < math.MinInt64 { if f < math.MinInt64 {
return 0, fmt.Errorf("too small timestamp in nanoseconds: %v; must be bigger or equal to %v", f, math.MinInt64) return 0, fmt.Errorf("too small timestamp in nanoseconds: %v; must be bigger or equal to %v", f, int64(math.MinInt64))
} }
n = int64(f) n = int64(f)
} }