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

Method WriteToBytes

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

WriteToBytes serializes this document into a slice of bytes.

()

Source from the content-addressed store, hash-verified

459
460// WriteToBytes serializes this document into a slice of bytes.
461func (d *Document) WriteToBytes() (b []byte, err error) {
462 var buf bytes.Buffer
463 if _, err = d.WriteTo(&buf); err != nil {
464 return
465 }
466 return buf.Bytes(), nil
467}
468
469// WriteToString serializes this document into a string.
470func (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