MCPcopy Create free account
hub / github.com/cogentcore/core / WriteEnd

Method WriteEnd

svg/xml.go:219–240  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

217}
218
219func (xe *XMLEncoder) WriteEnd(name string) error {
220 xe.CurIndent--
221 if name == "" {
222 return fmt.Errorf("xml: end tag with no name")
223 }
224 if xe.CurStart == name {
225 xe.WriteString(" />")
226 xe.WriteEOL()
227 } else {
228 if !xe.NoEndIndent {
229 xe.WriteIndent()
230 }
231 xe.NoEndIndent = false
232 xe.WriteString("</")
233 xe.WriteString(name)
234 xe.WriteString(">")
235 xe.WriteEOL()
236 }
237 xe.CurStart = ""
238 xe.Flush()
239 return nil
240}
241
242func (xe *XMLEncoder) Flush() {
243 if bw, isb := xe.Writer.(*bufio.Writer); isb {

Callers 4

EncodeTokenMethod · 0.95
MarshalXMLGradientFunction · 0.80
MarshalXMLTreeFunction · 0.80
MarshalXMLxMethod · 0.80

Calls 5

WriteStringMethod · 0.95
WriteEOLMethod · 0.95
WriteIndentMethod · 0.95
FlushMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected