Golang拼接字符串的5种方法及其效率_Chrispink-CSDN博客_golang 字符串拼接效率 https://blog.csdn.net/m0_37422289/article/details/103362740

Different ways to concatenate two strings in Golang - GeeksforGeeks https://www.geeksforgeeks.org/different-ways-to-concatenate-two-strings-in-golang/

 

 

Golang拼接字符串的5种方法及其效率_Chrispink-CSDN博客_golang 字符串拼接效率 https://blog.csdn.net/m0_37422289/article/details/103362740

 

var buf bytes.Buffer
buf.WriteString(r)
buf.WriteString(s)

f := func(s string) string {
fmt.Println("START--", n())
r := s
for i := 0; i < 10241024; i++ {
r += s

}
fmt.Println("END--", n())

return r
}

 

posted @ 2020-12-03 11:37  papering  阅读(252)  评论(0编辑  收藏  举报