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

Method WriteToFile

etree.go:450–458  ·  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

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

Callers

nothing calls this directly

Calls 1

WriteToMethod · 0.95

Tested by

no test coverage detected