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