diff options
Diffstat (limited to 'pkg/utils/utils.go')
-rw-r--r-- | pkg/utils/utils.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 0333ac45a..f56ea8884 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -64,6 +64,13 @@ func TrimTrailingNewline(str string) string { return str } +// NormalizeLinefeeds - Removes all Windows and Mac style line feeds +func NormalizeLinefeeds(str string) string { + str = strings.Replace(str, "\r\n", "", -1) + str = strings.Replace(str, "\r", "", -1) + return str +} + // GetProjectRoot returns the path to the root of the project. Only to be used // in testing contexts, as with binaries it's unlikely this path will exist on // the machine |