diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index c93e35222d..5cf12f0888 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -797,7 +797,7 @@ func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, [] // [...]byte var bytes []byte if val.CanAddr() { - bytes = val.Slice(0, val.Len()).Bytes() + bytes = val.Bytes() } else { bytes = make([]byte, val.Len()) reflect.Copy(reflect.ValueOf(bytes), val)