Procházet zdrojové kódy

fix golint issues, and optimize code (#705)

Kevin Wan před 4 roky
rodič
revize
f300408fc0
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2 3
      tools/goctl/model/sql/util/newline.go

+ 2 - 3
tools/goctl/model/sql/util/newline.go

@@ -2,8 +2,7 @@ package util
 
 import "strings"
 
+// TrimNewLine trims \r and \n chars.
 func TrimNewLine(s string) string {
-	s = strings.ReplaceAll(s, "\r", "")
-	s = strings.ReplaceAll(s, "\n", "")
-	return s
+	return strings.NewReplacer("\r", "", "\n", "").Replace(s)
 }