Skip to content

Commit 9ec8835

Browse files
relastleHiroki-Konishi
authored andcommitted
Update: ReplaceAll -> Replace
1 parent fdc7229 commit 9ec8835

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/out.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func newPmyOutFromRule(rule *pmyRule) pmyOut {
5252
// into `a_a` and `b_b` respectively.
5353
func encodeTag(tag string) string {
5454
sEnc := base64.StdEncoding.EncodeToString([]byte(tag))
55-
sEnc = strings.ReplaceAll(sEnc, "/", "a_a")
56-
sEnc = strings.ReplaceAll(sEnc, "+", "b_b")
57-
sEnc = strings.ReplaceAll(sEnc, "=", "c_c")
55+
sEnc = strings.Replace(sEnc, "/", "a_a", -1)
56+
sEnc = strings.Replace(sEnc, "+", "b_b", -1)
57+
sEnc = strings.Replace(sEnc, "=", "c_c", -1)
5858
return sEnc
5959
}
6060

src/utils/string.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ func MakeNString(n int, s string) string {
1616

1717
// Escape escape cetrain string
1818
func Escape(target string, query string) string {
19-
return strings.ReplaceAll(target, query, fmt.Sprintf("\\%s", query))
19+
return strings.Replace(target, query, fmt.Sprintf("\\%s", query), -1)
2020
}

0 commit comments

Comments
 (0)