MCPcopy
hub / github.com/tinylib/msgp / writeString

Method writeString

msgp/write.go:300–313  ·  view source on GitHub ↗

implements io.WriteString

(s string)

Source from the content-addressed store, hash-verified

298
299// implements io.WriteString
300func (mw *Writer) writeString(s string) error {
301 l := len(s)
302 if mw.avail() < l {
303 if err := mw.flush(); err != nil {
304 return err
305 }
306 if l > len(mw.buf) {
307 _, err := io.WriteString(mw.w, s)
308 return err
309 }
310 }
311 mw.wloc += copy(mw.buf[mw.wloc:], s)
312 return nil
313}
314
315// Reset changes the underlying writer used by the Writer
316func (mw *Writer) Reset(w io.Writer) {

Callers 1

WriteStringMethod · 0.95

Calls 3

availMethod · 0.95
flushMethod · 0.95
WriteStringMethod · 0.65

Tested by

no test coverage detected