hcl/testhelper/unix2dos.go
James Nugent 4b7727828a Fix scanner tests on Windows
This is necessary because of the effects of autocrlf on Windows.
2016-03-20 23:14:42 +00:00

15 lines
234 B
Go

package testhelper
import (
"runtime"
"strings"
)
// Converts the line endings when on Windows
func Unix2dos(unix string) string {
if runtime.GOOS != "windows" {
return unix
}
return strings.Replace(unix, "\n", "\r\n", -1)
}