Skip to content

Commit 4e4baac

Browse files
committed
using Mutex lock and update benchmark
1 parent bc704c8 commit 4e4baac

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

excelize.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131

3232
// File define a populated spreadsheet file struct.
3333
type File struct {
34-
sync.RWMutex
34+
sync.Mutex
3535
xmlAttr map[string][]xml.Attr
3636
checked map[string]bool
3737
sheetMap map[string]string

file_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func BenchmarkWrite(b *testing.B) {
1919
if err != nil {
2020
b.Error(err)
2121
}
22-
if err := f.SetCellDefault("Sheet1", val, s); err != nil {
22+
if err := f.SetCellValue("Sheet1", val, s); err != nil {
2323
b.Error(err)
2424
}
2525
}

xmlWorksheet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// xlsxWorksheet directly maps the worksheet element in the namespace
2020
// http://schemas.openxmlformats.org/spreadsheetml/2006/main.
2121
type xlsxWorksheet struct {
22-
sync.RWMutex
22+
sync.Mutex
2323
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
2424
SheetPr *xlsxSheetPr `xml:"sheetPr"`
2525
Dimension *xlsxDimension `xml:"dimension"`

0 commit comments

Comments
 (0)