escape backwards slash for windows files with replace
Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
parent
2a00a02a2e
commit
5172edd2b2
1 changed files with 2 additions and 2 deletions
|
|
@ -1,13 +1,13 @@
|
|||
package test
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func NormalizeRelativePath(posixPath string) string {
|
||||
if runtime.GOOS == "windows" {
|
||||
return filepath.FromSlash(posixPath)
|
||||
return strings.ReplaceAll(posixPath, "/", "\\")
|
||||
}
|
||||
return posixPath
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue