using Mutex lock and update benchmark

formula
xuri 4 years ago
parent bc704c854f
commit 4e4baac3bc

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

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

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

Loading…
Cancel
Save