summaryrefslogtreecommitdiff
path: root/chart.go
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2022-06-12 00:19:12 +0800
committerGitHub <noreply@github.com>2022-06-12 00:19:12 +0800
commit6bcf5e4ede160af2ad04f5e69636211a5ced132d (patch)
tree836568f4c83f24d87acbd26f172f967c7a6a1118 /chart.go
parentf5d3d59d8c65d9396893ae0156fef21592f6f425 (diff)
refactor: replace strings.Replace with strings.ReplaceAll (#1250)
strings.ReplaceAll(s, old, new) is a wrapper function for strings.Replace(s, old, new, -1). But strings.ReplaceAll is more readable and removes the hardcoded -1. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Diffstat (limited to 'chart.go')
-rw-r--r--chart.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/chart.go b/chart.go
index 7b7162b..7dcbe19 100644
--- a/chart.go
+++ b/chart.go
@@ -1001,7 +1001,7 @@ func (f *File) DeleteChart(sheet, cell string) (err error) {
if ws.Drawing == nil {
return
}
- drawingXML := strings.Replace(f.getSheetRelationshipsTargetByID(sheet, ws.Drawing.RID), "..", "xl", -1)
+ drawingXML := strings.ReplaceAll(f.getSheetRelationshipsTargetByID(sheet, ws.Drawing.RID), "..", "xl")
return f.deleteDrawing(col, row, drawingXML, "Chart")
}