WriteToBytes serializes this document into a slice of bytes.
()
| 465 | |
| 466 | // WriteToBytes serializes this document into a slice of bytes. |
| 467 | func (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. |
| 476 | func (d *Document) WriteToString() (s string, err error) { |
no test coverage detected