1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-17 20:17:02 +03:00

fix: reader float parser (#2513)

This commit is contained in:
iliyanm 2023-04-04 16:50:07 +03:00 committed by GitHub
parent 37c057b8e5
commit 46f245075e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,6 +189,8 @@ func (r *Reader) readFloat(line []byte) (float64, error) {
return math.Inf(1), nil
case "-inf":
return math.Inf(-1), nil
case "nan", "-nan":
return math.NaN(), nil
}
return strconv.ParseFloat(v, 64)
}