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

Method WriteTextAppenderString

msgp/write.go:939–952  ·  view source on GitHub ↗

WriteTextAppenderString will write the bytes from the given encoding.TextAppender as a string.

(b encoding.TextAppender)

Source from the content-addressed store, hash-verified

937// WriteTextAppenderString will write the bytes from the given
938// encoding.TextAppender as a string.
939func (mw *Writer) WriteTextAppenderString(b encoding.TextAppender) (err error) {
940 defer func() {
941 if r := recover(); r != nil {
942 err = fmt.Errorf("msgp: panic during AppendText: %v", r)
943 }
944 }()
945 dst := bytesPool.Get().([]byte)
946 defer bytesPool.Put(dst) //nolint:staticcheck
947 dst, err = b.AppendText(dst[:0])
948 if err != nil {
949 return err
950 }
951 return mw.WriteStringFromBytes(dst)
952}

Callers

nothing calls this directly

Calls 2

WriteStringFromBytesMethod · 0.95
AppendTextMethod · 0.45

Tested by

no test coverage detected