MCPcopy Index your code
hub / github.com/golang/groupcache / WriteTo

Method WriteTo

byteview.go:163–175  ·  view source on GitHub ↗

WriteTo implements io.WriterTo on the bytes in v.

(w io.Writer)

Source from the content-addressed store, hash-verified

161
162// WriteTo implements io.WriterTo on the bytes in v.
163func (v ByteView) WriteTo(w io.Writer) (n int64, err error) {
164 var m int
165 if v.b != nil {
166 m, err = w.Write(v.b)
167 } else {
168 m, err = io.WriteString(w, v.s)
169 }
170 if err == nil && m < v.Len() {
171 err = io.ErrShortWrite
172 }
173 n = int64(m)
174 return
175}

Callers 1

TestByteViewFunction · 0.80

Calls 1

LenMethod · 0.95

Tested by 1

TestByteViewFunction · 0.64