MCPcopy Index your code
hub / github.com/maruel/panicparse / readSlice

Method readSlice

stack/reader.go:57–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57func (r *reader) readSlice() ([]byte, error) {
58 for s := 0; ; r.fill() {
59 if i := bytes.IndexByte(r.buf[r.r+s:r.w], '\n'); i >= 0 {
60 i += s
61 line := r.buf[r.r : r.r+i+1]
62 r.r += i + 1
63 return line, nil
64 }
65 if r.err != nil {
66 line := r.buf[r.r:r.w]
67 r.r = r.w
68 err := r.err
69 r.err = nil
70 return line, err
71 }
72 if r.w-r.r == len(r.buf) {
73 r.r = r.w
74 return r.buf[:], errBufferFull
75 }
76 s = r.w - r.r
77 }
78}
79
80// readLine is our own implementation of ReadBytes().
81//

Callers 1

readLineMethod · 0.95

Calls 1

fillMethod · 0.95

Tested by

no test coverage detected