mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 03:33:53 +08:00
perf: 根据golangci检测结果,优化部分代码
This commit is contained in:
@@ -97,5 +97,5 @@ func (bf *formattedBuffer) writeToken(token string, kind formatterTokenType) {
|
||||
|
||||
// unifyLineFeed unifies line feeds.
|
||||
func unifyLineFeed(s string) string {
|
||||
return strings.Replace(strings.Replace(s, "\r\n", "\n", -1), "\r", "\n", -1)
|
||||
return strings.ReplaceAll(strings.ReplaceAll(s, "\r\n", "\n"), "\r", "\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user