MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / WriteTo

Method WriteTo

xmlparser/tokens.go:22–44  ·  view source on GitHub ↗

WriteTo writes the XML representation of the start element to the provided writer.

(w TokenWriter)

Source from the content-addressed store, hash-verified

20
21// WriteTo writes the XML representation of the start element to the provided writer.
22func (e *StartElement) WriteTo(w TokenWriter) error {
23 if err := w.WriteByte('<'); err != nil {
24 return err
25 }
26 if _, err := w.WriteString(e.Name.String()); err != nil {
27 return err
28 }
29
30 e.writeAttrsTo(w)
31
32 if e.SelfClosing {
33 if _, err := w.WriteString("/>"); err != nil {
34 return err
35 }
36 return nil
37 }
38
39 if err := w.WriteByte('>'); err != nil {
40 return err
41 }
42
43 return nil
44}
45
46// writeAttrsTo writes the attributes of the start element to the provided writer.
47func (e *StartElement) writeAttrsTo(w TokenWriter) error {

Callers 1

WriteToMethod · 0.95

Calls 3

writeAttrsToMethod · 0.95
WriteByteMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected