Browse Source

using Mutex lock and update benchmark

xuri 5 years ago
parent
commit
4e4baac3bc
3 changed files with 3 additions and 3 deletions
  1. 1 1
      excelize.go
  2. 1 1
      file_test.go
  3. 1 1
      xmlWorksheet.go

+ 1 - 1
excelize.go

@@ -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

+ 1 - 1
file_test.go

@@ -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)
 				}
 			}

+ 1 - 1
xmlWorksheet.go

@@ -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"`