From 802eeac6e65272a440700c53a825d4e06309e0c7 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Fri, 4 Oct 2024 18:52:25 +0800 Subject: [PATCH] fix: fix slice init length --- php.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php.go b/php.go index 3e472b7..c80abf4 100644 --- a/php.go +++ b/php.go @@ -579,7 +579,7 @@ func Strtr(haystack string, params ...interface{}) string { if length == 0 { return haystack } - oldnew := make([]string, length*2) + oldnew := make([]string, 0, length*2) for o, n := range pairs { if o == "" { return haystack