From b6cc43d8242fd3f7f0c6163db9fcd759b9b992b1 Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 11 Sep 2022 00:04:04 +0800 Subject: This makes 6 functions concurrency safety - These 6 functions now support concurrency safe: SetColWidth, GetColWidth, SetColVisible, GetColVisible, SetColStyle and GetColStyle --- styles.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'styles.go') diff --git a/styles.go b/styles.go index 87c4863..ded7c30 100644 --- a/styles.go +++ b/styles.go @@ -1005,8 +1005,9 @@ func parseFormatStyleSet(style interface{}) (*Style, error) { return &fs, err } -// NewStyle provides a function to create the style for cells by given JSON or -// structure pointer. Note that the color field uses RGB color code. +// NewStyle provides a function to create the style for cells by given +// structure pointer or JSON. This function is concurrency safe. Note that the +// color field uses RGB color code. // // The following shows the border styles sorted by excelize index number: // @@ -2493,10 +2494,10 @@ func (f *File) GetCellStyle(sheet, axis string) (int, error) { } // SetCellStyle provides a function to add style attribute for cells by given -// worksheet name, coordinate area and style ID. Note that diagonalDown and -// diagonalUp type border should be use same color in the same coordinate -// area. SetCellStyle will overwrite the existing styles for the cell, it -// won't append or merge style with existing styles. +// worksheet name, coordinate area and style ID. This function is concurrency +// safe. Note that diagonalDown and diagonalUp type border should be use same +// color in the same coordinate area. SetCellStyle will overwrite the existing +// styles for the cell, it won't append or merge style with existing styles. // // For example create a borders of cell H9 on Sheet1: // -- cgit v1.2.1