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