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

Method WriteToFile

etree.go:456–464  ·  view source on GitHub ↗

WriteToFile serializes the document out to the file at path 'filepath'.

(filepath string)

Source from the content-addressed store, hash-verified

454
455// WriteToFile serializes the document out to the file at path 'filepath'.
456func (d *Document) WriteToFile(filepath string) error {
457 f, err := os.Create(filepath)
458 if err != nil {
459 return err
460 }
461 defer f.Close()
462 _, err = d.WriteTo(f)
463 return err
464}
465
466// WriteToBytes serializes this document into a slice of bytes.
467func (d *Document) WriteToBytes() (b []byte, err error) {

Callers

nothing calls this directly

Calls 1

WriteToMethod · 0.95

Tested by

no test coverage detected