diff options
author | xuri <xuri.me@gmail.com> | 2022-10-13 00:02:53 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-10-13 00:13:36 +0800 |
commit | 7363c1e3337c5f0d9c70cc8af7504b3f8c092ab4 (patch) | |
tree | afe4236975d8144d0ffdd55fef7723b2a0295495 /lib.go | |
parent | 0e657c887bf505d62ce3bf685c518cd0ed7bc558 (diff) |
Go 1.16 and later required, migration of deprecation package `ioutil`
- Improving performance for stream writer `SetRow` function, reduces memory usage over and speedup about 19%
- Update dependencies module
- Update GitHub workflow
Diffstat (limited to 'lib.go')
-rw-r--r-- | lib.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -18,7 +18,6 @@ import ( "encoding/xml" "fmt" "io" - "io/ioutil" "math/big" "os" "regexp" @@ -73,7 +72,7 @@ func (f *File) ReadZipReader(r *zip.Reader) (map[string][]byte, int, error) { // unzipToTemp unzip the zip entity to the system temporary directory and // returned the unzipped file path. func (f *File) unzipToTemp(zipFile *zip.File) (string, error) { - tmp, err := ioutil.TempFile(os.TempDir(), "excelize-") + tmp, err := os.CreateTemp(os.TempDir(), "excelize-") if err != nil { return "", err } @@ -111,7 +110,7 @@ func (f *File) readBytes(name string) []byte { if err != nil { return content } - content, _ = ioutil.ReadAll(file) + content, _ = io.ReadAll(file) f.Pkg.Store(name, content) _ = file.Close() return content |