diff options
author | xuri <xuri.me@gmail.com> | 2020-08-14 16:09:50 +0000 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-08-15 09:19:35 +0000 |
commit | c3e92a51d744bc8420e0626b06ee3a0efd030341 (patch) | |
tree | 3ddf72f53711ae898baf584287d6b4b7ad4276b9 /rows.go | |
parent | cb6f8852bb764ffc1f9b637faaf594353476e17c (diff) |
Compatible with Go 1.15, fix unit test failed on Windows and fixed #689 potential race condition
Diffstat (limited to 'rows.go')
-rw-r--r-- | rows.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -284,6 +284,8 @@ func (f *File) GetRowHeight(sheet string, row int) (float64, error) { func (f *File) sharedStringsReader() *xlsxSST { var err error + f.Lock() + defer f.Unlock() if f.SharedStrings == nil { var sharedStrings xlsxSST ss := f.readXML("xl/sharedStrings.xml") @@ -318,6 +320,8 @@ func (f *File) sharedStringsReader() *xlsxSST { // inteded to be used with for range on rows an argument with the xlsx opened // file. func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) { + f.Lock() + defer f.Unlock() switch xlsx.T { case "s": if xlsx.V != "" { |