MCPcopy
hub / github.com/redis/go-redis / readFloat

Method readFloat

internal/proto/reader.go:350–361  ·  view source on GitHub ↗
(line []byte)

Source from the content-addressed store, hash-verified

348}
349
350func (r *Reader) readFloat(line []byte) (float64, error) {
351 v := util.BytesToString(line[1:])
352 switch v {
353 case "inf":
354 return math.Inf(1), nil
355 case "-inf":
356 return math.Inf(-1), nil
357 case "nan", "-nan":
358 return math.NaN(), nil
359 }
360 return strconv.ParseFloat(v, 64)
361}
362
363func (r *Reader) readBool(line []byte) (bool, error) {
364 switch util.BytesToString(line[1:]) {

Callers 2

ReadReplyMethod · 0.95
ReadFloatMethod · 0.95

Calls 1

BytesToStringFunction · 0.92

Tested by

no test coverage detected