From 01e7668915c4e3cf8c9eeca283d41beac924fe1f Mon Sep 17 00:00:00 2001 From: Zhizhen He Date: Sat, 18 May 2024 16:06:33 +0800 Subject: chore: use strings.ReplaceAll (#3801) --- src/options.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/options.go') diff --git a/src/options.go b/src/options.go index 83b0e97f..0265693a 100644 --- a/src/options.go +++ b/src/options.go @@ -554,7 +554,7 @@ func splitNth(str string) ([]Range, error) { func delimiterRegexp(str string) Delimiter { // Special handling of \t - str = strings.Replace(str, "\\t", "\t", -1) + str = strings.ReplaceAll(str, "\\t", "\t") // 1. Pattern does not contain any special character if regexp.QuoteMeta(str) == str { @@ -1132,9 +1132,9 @@ Loop: masked += strings.Repeat(" ", loc[1]) action = action[loc[1]:] } - masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1) - masked = strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1) - masked = strings.Replace(masked, "+:", string([]rune{escapedPlus, ':'}), -1) + masked = strings.ReplaceAll(masked, "::", string([]rune{escapedColon, ':'})) + masked = strings.ReplaceAll(masked, ",:", string([]rune{escapedComma, ':'})) + masked = strings.ReplaceAll(masked, "+:", string([]rune{escapedPlus, ':'})) return masked } -- cgit v1.2.3