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 /excelize.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 'excelize.go')
-rw-r--r-- | excelize.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/excelize.go b/excelize.go index 94d1088..987314b 100644 --- a/excelize.go +++ b/excelize.go @@ -18,7 +18,6 @@ import ( "encoding/xml" "fmt" "io" - "io/ioutil" "os" "path" "path/filepath" @@ -137,7 +136,7 @@ func newFile() *File { // OpenReader read data stream from io.Reader and return a populated // spreadsheet file. func OpenReader(r io.Reader, opts ...Options) (*File, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, err } @@ -488,7 +487,7 @@ func (f *File) AddVBAProject(bin string) error { Type: SourceRelationshipVBAProject, }) } - file, _ := ioutil.ReadFile(filepath.Clean(bin)) + file, _ := os.ReadFile(filepath.Clean(bin)) f.Pkg.Store("xl/vbaProject.bin", file) return err } |