(name Name)
| 749 | } |
| 750 | |
| 751 | func (p *printer) writeEnd(name Name) error { |
| 752 | if name.Local == "" { |
| 753 | return fmt.Errorf("xml: end tag with no name") |
| 754 | } |
| 755 | if len(p.tags) == 0 || p.tags[len(p.tags)-1].Local == "" { |
| 756 | return fmt.Errorf("xml: end tag </%s> without start tag", name.Local) |
| 757 | } |
| 758 | if top := p.tags[len(p.tags)-1]; top != name { |
| 759 | if top.Local != name.Local { |
| 760 | return fmt.Errorf("xml: end tag </%s> does not match start tag <%s>", name.Local, top.Local) |
| 761 | } |
| 762 | return fmt.Errorf("xml: end tag </%s> in namespace %s does not match start tag <%s> in namespace %s", name.Local, name.Space, top.Local, top.Space) |
| 763 | } |
| 764 | p.tags = p.tags[:len(p.tags)-1] |
| 765 | |
| 766 | p.writeIndent(-1) |
| 767 | p.WriteByte('<') |
| 768 | p.WriteByte('/') |
| 769 | p.WriteString(name.Local) |
| 770 | p.WriteByte('>') |
| 771 | p.popPrefix() |
| 772 | return nil |
| 773 | } |
| 774 | |
| 775 | func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, []byte, error) { |
| 776 | switch val.Kind() { |
no test coverage detected