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

Method readLine

stack/reader.go:88–103  ·  view source on GitHub ↗

readLine is our own implementation of ReadBytes(). We try to use readSlice() as much as we can but we need to tolerate if an input line is longer than the buffer specified at Reader creation. Not using the more complicated slice of slices that Reader.ReadBytes() uses since it should not happen ofte

()

Source from the content-addressed store, hash-verified

86// starting with 4x buffer size, which should get most cases with a single
87// allocation.
88func (r *reader) readLine() ([]byte, error) {
89 var d []byte
90 for {
91 f, err := r.readSlice()
92 if err != errBufferFull {
93 if d == nil {
94 return f, err
95 }
96 return append(d, f...), err
97 }
98 if d == nil {
99 d = make([]byte, 0, len(f)*4)
100 }
101 d = append(d, f...)
102 }
103}

Callers 1

ScanSnapshotFunction · 0.95

Calls 1

readSliceMethod · 0.95

Tested by

no test coverage detected