(name string)
| 217 | } |
| 218 | |
| 219 | func (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 | |
| 242 | func (xe *XMLEncoder) Flush() { |
| 243 | if bw, isb := xe.Writer.(*bufio.Writer); isb { |
no test coverage detected