mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
feat: revert bytes.Buffer to strings.Builder
This commit is contained in:
parent
d9a732a273
commit
981d7dab13
@ -1,8 +1,6 @@
|
||||
package stringx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
import "strings"
|
||||
|
||||
type (
|
||||
// Replacer interface wraps the Replace method.
|
||||
@ -32,7 +30,7 @@ func NewReplacer(mapping map[string]string) Replacer {
|
||||
|
||||
// Replace replaces text with given substitutes.
|
||||
func (r *replacer) Replace(text string) string {
|
||||
var buf bytes.Buffer
|
||||
var buf strings.Builder
|
||||
target := []rune(text)
|
||||
cur := r.node
|
||||
nextStart := 0
|
||||
|
Loading…
Reference in New Issue
Block a user