Skip to content

Commit

Permalink
fix golint issues, and optimize code (zeromicro#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan authored May 21, 2021
1 parent aaa39e1 commit f300408
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/goctl/model/sql/util/newline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit f300408

Please sign in to comment.