summaryrefslogtreecommitdiff
path: root/src/options.go
diff options
context:
space:
mode:
authorZhizhen He <hezhizhen.yi@gmail.com>2024-05-18 16:06:33 +0800
committerGitHub <noreply@github.com>2024-05-18 17:06:33 +0900
commit01e7668915c4e3cf8c9eeca283d41beac924fe1f (patch)
tree721306578106c58da6cdb0c04543eaba53b7d5a1 /src/options.go
parent0994d9c881f8380997b96bb0a4a7416b50bc2b0d (diff)
downloadfzf-01e7668915c4e3cf8c9eeca283d41beac924fe1f.tar.gz
chore: use strings.ReplaceAll (#3801)
Diffstat (limited to 'src/options.go')
-rw-r--r--src/options.go8
1 files changed, 4 insertions, 4 deletions
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
}