summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-07-05 00:03:56 +0800
committerxuri <xuri.me@gmail.com>2021-07-05 00:03:56 +0800
commit544ef18a8cb9949fcb8833c6d2816783c90f3318 (patch)
tree88bb3eaa9d92522d3b5c4eeb052210c26bc4c99f /lib.go
parent0e02329bedf6648259fd219642bb907bdb07fd21 (diff)
- Support concurrency iterate rows and columns
- Rename exported field `File.XLSX` to `File.Pkg` - Exported error message
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib.go b/lib.go
index 5c9bbf6..00a67d9 100644
--- a/lib.go
+++ b/lib.go
@@ -51,8 +51,8 @@ func ReadZipReader(r *zip.Reader) (map[string][]byte, int, error) {
// readXML provides a function to read XML content as string.
func (f *File) readXML(name string) []byte {
- if content, ok := f.XLSX[name]; ok {
- return content
+ if content, _ := f.Pkg.Load(name); content != nil {
+ return content.([]byte)
}
if content, ok := f.streams[name]; ok {
return content.rawData.buf.Bytes()
@@ -66,7 +66,7 @@ func (f *File) saveFileList(name string, content []byte) {
newContent := make([]byte, 0, len(XMLHeader)+len(content))
newContent = append(newContent, []byte(XMLHeader)...)
newContent = append(newContent, content...)
- f.XLSX[name] = newContent
+ f.Pkg.Store(name, newContent)
}
// Read file content as string in a archive file.