diff options
author | xuri <xuri.me@gmail.com> | 2021-08-09 22:22:43 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-08-09 22:22:43 +0800 |
commit | c49e7aab306437f0e721620af4a24364edf4d601 (patch) | |
tree | 88ffb72996214d993626083487860f699de8bdf5 /sparkline.go | |
parent | cf9fbafdd805874267a0f5d27fd1c720b148ec91 (diff) |
Reduce cyclomatic complexities for the formula calculate function and update documentation for the API: `MergeCell` and `GetCellValue`
Diffstat (limited to 'sparkline.go')
-rw-r--r-- | sparkline.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sparkline.go b/sparkline.go index 5326c60..917383d 100644 --- a/sparkline.go +++ b/sparkline.go @@ -524,10 +524,11 @@ func (f *File) appendSparkline(ws *xlsxWorksheet, group *xlsxX14SparklineGroup, if sparklineGroupBytes, err = xml.Marshal(group); err != nil { return } - groups = &xlsxX14SparklineGroups{ - XMLNSXM: NameSpaceSpreadSheetExcel2006Main.Value, - Content: decodeSparklineGroups.Content + string(sparklineGroupBytes), + if groups == nil { + groups = &xlsxX14SparklineGroups{} } + groups.XMLNSXM = NameSpaceSpreadSheetExcel2006Main.Value + groups.Content = decodeSparklineGroups.Content + string(sparklineGroupBytes) if sparklineGroupsBytes, err = xml.Marshal(groups); err != nil { return } |