diff options
author | xuri <xuri.me@gmail.com> | 2022-09-11 00:04:04 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-09-11 00:04:04 +0800 |
commit | b6cc43d8242fd3f7f0c6163db9fcd759b9b992b1 (patch) | |
tree | 3bf1b4b6d37f006ced435931a8aad10d2e652a24 /cell.go | |
parent | c72fb747b8a64117538229f1e5a85d220349b6f1 (diff) |
This makes 6 functions concurrency safety
- These 6 functions now support concurrency safe: SetColWidth, GetColWidth, SetColVisible, GetColVisible, SetColStyle and GetColStyle
Diffstat (limited to 'cell.go')
-rw-r--r-- | cell.go | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -60,7 +60,7 @@ var cellTypes = map[string]CellType{ // worksheet name and axis in spreadsheet file. If it is possible to apply a // format to the cell value, it will do so, if not then an error will be // returned, along with the raw value of the cell. All cells' values will be -// the same in a merged range. +// the same in a merged range. This function is concurrency safe. func (f *File) GetCellValue(sheet, axis string, opts ...Options) (string, error) { return f.getCellStringFunc(sheet, axis, func(x *xlsxWorksheet, c *xlsxC) (string, bool, error) { val, err := c.getValueFrom(f, f.sharedStringsReader(), parseOptions(opts...).RawCellValue) @@ -85,10 +85,10 @@ func (f *File) GetCellType(sheet, axis string) (CellType, error) { return cellType, err } -// SetCellValue provides a function to set the value of a cell. The specified -// coordinates should not be in the first row of the table, a complex number -// can be set with string text. The following shows the supported data -// types: +// SetCellValue provides a function to set the value of a cell. This function +// is concurrency safe. The specified coordinates should not be in the first +// row of the table, a complex number can be set with string text. The +// following shows the supported data types: // // int // int8 @@ -1047,8 +1047,9 @@ func (f *File) SetCellRichText(sheet, cell string, runs []RichTextRun) error { } // SetSheetRow writes an array to row by given worksheet name, starting -// coordinate and a pointer to array type 'slice'. For example, writes an -// array to row 6 start with the cell B6 on Sheet1: +// coordinate and a pointer to array type 'slice'. This function is +// concurrency safe. For example, writes an array to row 6 start with the cell +// B6 on Sheet1: // // err := f.SetSheetRow("Sheet1", "B6", &[]interface{}{"1", nil, 2}) func (f *File) SetSheetRow(sheet, axis string, slice interface{}) error { |