1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-03 00:57:52 +02:00

Fix warning QF1004: could use strings.ReplaceAll instead

This commit is contained in:
Stefan Haller
2025-06-20 19:57:03 +02:00
parent 4604227238
commit c7d0aaa786
7 changed files with 12 additions and 12 deletions

View File

@ -11,7 +11,7 @@ import (
// currently we are also stripping \r's which may have adverse effects for
// windows users (but no issues have been raised yet)
func SplitLines(multilineString string) []string {
multilineString = strings.Replace(multilineString, "\r", "", -1)
multilineString = strings.ReplaceAll(multilineString, "\r", "")
if multilineString == "" || multilineString == "\n" {
return make([]string, 0)
}
@ -32,8 +32,8 @@ func SplitNul(str string) []string {
// NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func NormalizeLinefeeds(str string) string {
str = strings.Replace(str, "\r\n", "\n", -1)
str = strings.Replace(str, "\r", "", -1)
str = strings.ReplaceAll(str, "\r\n", "\n")
str = strings.ReplaceAll(str, "\r", "")
return str
}