diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index 7ee6700dcc279c..9eb63ee2b13bec 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -586,7 +586,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat } } - // If a empty name was found, namespace is overridden with an empty space + // If an empty name was found, namespace is overridden with an empty space if tinfo.xmlname != nil && start.Name.Space == "" && tinfo.xmlname.xmlns == "" && tinfo.xmlname.name == "" && len(p.elements) != 0 && p.elements[len(p.elements)-1].xmlns != "" {