summaryrefslogtreecommitdiff
path: root/sparkline.go
diff options
context:
space:
mode:
authorOlivier Mengué <dolmen@cpan.org>2020-04-08 18:49:13 +0200
committerGitHub <noreply@github.com>2020-04-09 00:49:13 +0800
commit6e90fa6b1d00b2c4ce85e79ee4054ee847fbbc87 (patch)
tree98ad96ccc5ed2eb61226a242947a2188756e42db /sparkline.go
parent66d0272f6af59b5f0c97a304379a795420a43e8b (diff)
Replace bytes.NewReader(stringToBytes(s)) with strings.NewReader(s) (#610)
Diffstat (limited to 'sparkline.go')
-rw-r--r--sparkline.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/sparkline.go b/sparkline.go
index f1e1f40..ce5be4c 100644
--- a/sparkline.go
+++ b/sparkline.go
@@ -10,7 +10,6 @@
package excelize
import (
- "bytes"
"encoding/xml"
"errors"
"io"
@@ -509,14 +508,14 @@ func (f *File) appendSparkline(ws *xlsxWorksheet, group *xlsxX14SparklineGroup,
sparklineGroupsBytes, sparklineGroupBytes, extLstBytes []byte
)
decodeExtLst = new(decodeWorksheetExt)
- if err = f.xmlNewDecoder(bytes.NewReader([]byte("<extLst>" + ws.ExtLst.Ext + "</extLst>"))).
+ if err = f.xmlNewDecoder(strings.NewReader("<extLst>" + ws.ExtLst.Ext + "</extLst>")).
Decode(decodeExtLst); err != nil && err != io.EOF {
return
}
for idx, ext = range decodeExtLst.Ext {
if ext.URI == ExtURISparklineGroups {
decodeSparklineGroups = new(decodeX14SparklineGroups)
- if err = f.xmlNewDecoder(bytes.NewReader(stringToBytes(ext.Content))).
+ if err = f.xmlNewDecoder(strings.NewReader(ext.Content)).
Decode(decodeSparklineGroups); err != nil && err != io.EOF {
return
}