Add fixer for end-of-line characters.

This commit is contained in:
Amy Boyd
2016-07-04 13:54:44 +01:00
parent 03eddbde0c
commit 3463ab7d0f
3 changed files with 62 additions and 0 deletions

View File

@@ -47,3 +47,10 @@ func ExitBecauseOfInternalError(err string) {
fmt.Println(err)
os.Exit(2)
}
func GetErrorWithLineBreaksVisible(s string) string {
s = lfRegexp.ReplaceAllString(s, `\n`)
s = crRegexp.ReplaceAllString(s, `\r`)
s = crlfRegexp.ReplaceAllString(s, `\r\n`)
return s
}