diff options
| author | Zhizhen He <hezhizhen.yi@gmail.com> | 2024-05-18 16:06:33 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-18 17:06:33 +0900 |
| commit | 01e7668915c4e3cf8c9eeca283d41beac924fe1f (patch) | |
| tree | 721306578106c58da6cdb0c04543eaba53b7d5a1 /src/options.go | |
| parent | 0994d9c881f8380997b96bb0a4a7416b50bc2b0d (diff) | |
| download | fzf-01e7668915c4e3cf8c9eeca283d41beac924fe1f.tar.gz | |
chore: use strings.ReplaceAll (#3801)
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 8 |
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 } |
