{"id":"5768f34e228fe3dc","repo":"go-redis/redis","slug":"redis-can-t-parse-float-reply-100q","errorCode":null,"errorMessage":"redis: can't parse float reply: %.100q","messagePattern":"redis: can't parse float reply: %\\.100q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/proto/reader.go","lineNumber":563,"sourceCode":"\nfunc (r *Reader) ReadFloat() (float64, error) {\n\tline, err := r.ReadLine()\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tswitch line[0] {\n\tcase RespFloat:\n\t\treturn r.readFloat(line)\n\tcase RespStatus:\n\t\treturn strconv.ParseFloat(util.BytesToString(line[1:]), 64)\n\tcase RespString:\n\t\ts, err := r.readStringReply(line)\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t\treturn strconv.ParseFloat(s, 64)\n\t}\n\treturn 0, fmt.Errorf(\"redis: can't parse float reply: %.100q\", line)\n}\n\n// ReadStringInto reads a string-typed reply directly into buf, avoiding the\n// per-call allocation that ReadString incurs. It returns the number of bytes\n// written to buf.\n//\n// Supported reply types:\n//   - $<n>\\r\\n<payload>\\r\\n  bulk string (the GET path; payload is read\n//     straight into buf via bufio.Reader — for payloads larger than the\n//     bufio buffer this is effectively zero-copy from the socket)\n//   - +<status>\\r\\n          simple string, copied from the header line\n//   - :<int>\\r\\n             integer, copied as its ASCII representation\n//   - ,<float>\\r\\n           float, copied as its ASCII representation\n//\n// Errors, nil, push notifications, and RESP3 attributes are intercepted\n// by ReadLine and surfaced through err. RESP3 verbatim strings\n// (=<n>\\r\\n<txt:payload>\\r\\n) are intentionally not handled — they are\n// never returned by GET-family commands, and including them re-introduces","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/internal/proto/reader.go#L545-L581","documentation":"Error \"redis: can't parse float reply: %.100q\" thrown in go-redis/redis.","triggerScenarios":"Thrown at internal/proto/reader.go:563 when the library encounters an invalid state.","commonSituations":"Validate float strings with strconv before use and treat parse errors as conn-fatal.","solutions":["Inspect the quoted reply; the float field is malformed (or 'inf'/'nan' where unsupported)","Reconnect to resync the stream"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}