{"record":{"id":"d2a866d6ab19ed20","repo":"redis/go-redis","slug":"redis-failed-to-parse-float-q-v","errorCode":null,"errorMessage":"redis: failed to parse float %q: %v","messagePattern":"redis: failed to parse float %q: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/util/convert.go","lineNumber":27,"sourceCode":"// ParseFloat parses a Redis RESP3 float reply into a Go float64,\n// handling \"inf\", \"-inf\", \"nan\" per Redis conventions.\nfunc ParseStringToFloat(s string) (float64, error) {\n\tswitch s {\n\tcase \"inf\":\n\t\treturn math.Inf(1), nil\n\tcase \"-inf\":\n\t\treturn math.Inf(-1), nil\n\tcase \"nan\", \"-nan\":\n\t\treturn math.NaN(), nil\n\t}\n\treturn strconv.ParseFloat(s, 64)\n}\n\n// MustParseFloat is like ParseFloat but panics on parse errors.\nfunc MustParseFloat(s string) float64 {\n\tf, err := ParseStringToFloat(s)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"redis: failed to parse float %q: %v\", s, err))\n\t}\n\treturn f\n}\n\n// SafeIntToInt32 safely converts an int to int32, returning an error if overflow would occur.\nfunc SafeIntToInt32(value int, fieldName string) (int32, error) {\n\tif value > math.MaxInt32 {\n\t\treturn 0, fmt.Errorf(\"redis: %s value %d exceeds maximum allowed value %d\", fieldName, value, math.MaxInt32)\n\t}\n\tif value < math.MinInt32 {\n\t\treturn 0, fmt.Errorf(\"redis: %s value %d is below minimum allowed value %d\", fieldName, value, math.MinInt32)\n\t}\n\treturn int32(value), nil\n}\n","sourceCodeStart":9,"sourceCodeEnd":42,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/internal/util/convert.go#L9-L42","documentation":"Error \"redis: failed to parse float %q: %v\" thrown in redis/go-redis.","triggerScenarios":"Thrown at internal/util/convert.go:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}