stash/pkg/utils/windows.go

15 lines
299 B
Go
Raw Normal View History

2019-02-10 18:13:23 +00:00
package utils
import (
"runtime"
"strings"
)
// FixWindowsPath replaces \ with / in the given path because sometimes the \ isn't recognized as valid on windows
2019-02-10 18:13:23 +00:00
func FixWindowsPath(str string) string {
if runtime.GOOS == "windows" {
return strings.Replace(str, "\\", "/", -1)
}
return str
}