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

Method readStringReply

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

Source from the content-addressed store, hash-verified

379}
380
381func (r *Reader) readStringReply(line []byte) (string, error) {
382 n, err := replyLen(line)
383 if err != nil {
384 return "", err
385 }
386
387 b := make([]byte, n+2)
388 _, err = io.ReadFull(r.rd, b)
389 if err != nil {
390 return "", err
391 }
392
393 return util.BytesToString(b[:n]), nil
394}
395
396func (r *Reader) readVerb(line []byte) (string, error) {
397 s, err := r.readStringReply(line)

Callers 7

ReadLineMethod · 0.95
ReadReplyMethod · 0.95
readVerbMethod · 0.95
ReadIntMethod · 0.95
ReadUintMethod · 0.95
ReadFloatMethod · 0.95
ReadStringMethod · 0.95

Calls 2

BytesToStringFunction · 0.92
replyLenFunction · 0.85

Tested by

no test coverage detected