From 544ef18a8cb9949fcb8833c6d2816783c90f3318 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 5 Jul 2021 00:03:56 +0800 Subject: - Support concurrency iterate rows and columns - Rename exported field `File.XLSX` to `File.Pkg` - Exported error message --- lib.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib.go') 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. -- cgit v1.2.1