using Mutex lock and update benchmark

This commit is contained in:
xuri 2020-08-16 03:48:11 +00:00
parent bc704c854f
commit 4e4baac3bc
3 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ import (
// File define a populated spreadsheet file struct.
type File struct {
sync.RWMutex
sync.Mutex
xmlAttr map[string][]xml.Attr
checked map[string]bool
sheetMap map[string]string

View File

@ -19,7 +19,7 @@ func BenchmarkWrite(b *testing.B) {
if err != nil {
b.Error(err)
}
if err := f.SetCellDefault("Sheet1", val, s); err != nil {
if err := f.SetCellValue("Sheet1", val, s); err != nil {
b.Error(err)
}
}

View File

@ -19,7 +19,7 @@ import (
// xlsxWorksheet directly maps the worksheet element in the namespace
// http://schemas.openxmlformats.org/spreadsheetml/2006/main.
type xlsxWorksheet struct {
sync.RWMutex
sync.Mutex
XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main worksheet"`
SheetPr *xlsxSheetPr `xml:"sheetPr"`
Dimension *xlsxDimension `xml:"dimension"`