MCPcopy Create free account
hub / github.com/beevik/etree / WriteToBytes

Method WriteToBytes

etree.go:467–473  ·  view source on GitHub ↗

WriteToBytes serializes this document into a slice of bytes.

()

Source from the content-addressed store, hash-verified

465
466// WriteToBytes serializes this document into a slice of bytes.
467func (d *Document) WriteToBytes() (b []byte, err error) {
468 var buf bytes.Buffer
469 if _, err = d.WriteTo(&buf); err != nil {
470 return
471 }
472 return buf.Bytes(), nil
473}
474
475// WriteToString serializes this document into a string.
476func (d *Document) WriteToString() (s string, err error) {

Callers 1

WriteToStringMethod · 0.95

Calls 2

WriteToMethod · 0.95
BytesMethod · 0.65

Tested by

no test coverage detected