cli/pkg/cmd/attestation/test/path.go
Meredith Lancaster 5172edd2b2 escape backwards slash for windows files with replace
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-03-19 16:00:40 -06:00

13 lines
207 B
Go

package test
import (
"runtime"
"strings"
)
func NormalizeRelativePath(posixPath string) string {
if runtime.GOOS == "windows" {
return strings.ReplaceAll(posixPath, "/", "\\")
}
return posixPath
}