summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-08-14 16:09:50 +0000
committerxuri <xuri.me@gmail.com>2020-08-15 09:19:35 +0000
commitc3e92a51d744bc8420e0626b06ee3a0efd030341 (patch)
tree3ddf72f53711ae898baf584287d6b4b7ad4276b9 /rows.go
parentcb6f8852bb764ffc1f9b637faaf594353476e17c (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.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/rows.go b/rows.go
index 320ba2f..66dd16b 100644
--- a/rows.go
+++ b/rows.go
@@ -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 != "" {