Revert "Don't copy token."

This reverts commit bc81053dbc.
This commit is contained in:
Martin Dosch 2024-03-27 21:09:43 +01:00
parent 862c21f845
commit 0c7ee22452

View File

@ -1493,11 +1493,12 @@ func (c *Client) nextEnd() (xml.EndElement, error) {
c.p.Strict = false
for {
c.nextMutex.Lock()
t, err := c.p.RawToken()
if err != nil || t == nil {
to, err := c.p.RawToken()
if err != nil || to == nil {
c.nextMutex.Unlock()
return xml.EndElement{}, err
}
t := xml.CopyToken(to)
switch t := t.(type) {
case xml.EndElement:
c.nextMutex.Unlock()