Posted 2020-02-27Updated 2025-12-24 Jaco Liu Goa few seconds read (About 85 words)Go:stringstring常用拼接方法+= 来拼接bytes.Bufferstrings.Builder ( >= go1.10 )拼接方法性能对比使用 += 的方法性能是最慢的,性能消耗相对最大;Buffer 和 Builder 性能相差无几,Builder 在内存的使用上要略优于 Buffer;官方推荐 strings.Builder,优点: 性能好,代码清晰;Go:stringhttps://www.wdft.com/765e2161.htmlAuthorJaco LiuPosted on2020-02-27Updated on2025-12-24Licensed under#GoGo(string)