From 7fa2319599e2372be018046d58374450b8ec6f50 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 21 Oct 2021 01:51:28 +0900 Subject: [PATCH] Use `strings.ReplaceAll` instead of `strings.Replace` -1 (#11) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- builder/quote.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/quote.go b/builder/quote.go index 48fd956..4f6f627 100644 --- a/builder/quote.go +++ b/builder/quote.go @@ -29,7 +29,7 @@ type Quote struct { } func (q Quote) ID(name string) string { - return q.IDPrefix + strings.Replace(name, q.IDSuffix, q.IDSuffixEscapeChar+q.IDSuffix, -1) + q.IDSuffix + return q.IDPrefix + strings.ReplaceAll(name, q.IDSuffix, q.IDSuffixEscapeChar+q.IDSuffix) + q.IDSuffix } func (q Quote) Value(v interface{}) string { @@ -37,6 +37,6 @@ func (q Quote) Value(v interface{}) string { default: panic("unsupported value") case string: - return q.ValueQuote + strings.Replace(v, q.ValueQuote, q.ValueQuoteEscapeChar+q.ValueQuote, -1) + q.ValueQuote + return q.ValueQuote + strings.ReplaceAll(v, q.ValueQuote, q.ValueQuoteEscapeChar+q.ValueQuote) + q.ValueQuote } }