MCPcopy
hub / github.com/segmentio/kafka-go / writeTo

Method writeTo

protocol/decode.go:159–170  ·  view source on GitHub ↗
(w io.Writer, n int)

Source from the content-addressed store, hash-verified

157}
158
159func (d *decoder) writeTo(w io.Writer, n int) {
160 limit := d.remain
161 if n < limit {
162 d.remain = n
163 }
164 c, err := io.Copy(w, d)
165 if int(c) < n && err == nil {
166 err = io.ErrUnexpectedEOF
167 }
168 d.remain = limit - int(c)
169 d.setError(err)
170}
171
172func (d *decoder) setError(err error) {
173 if d.err == nil && err != nil {

Callers 1

readMessageFunction · 0.95

Calls 1

setErrorMethod · 0.95

Tested by

no test coverage detected