From 5172edd2b2277206149f09faafef05612ac10935 Mon Sep 17 00:00:00 2001 From: Meredith Lancaster Date: Tue, 19 Mar 2024 16:00:40 -0600 Subject: [PATCH] escape backwards slash for windows files with replace Signed-off-by: Meredith Lancaster --- pkg/cmd/attestation/test/path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/attestation/test/path.go b/pkg/cmd/attestation/test/path.go index 1e8d52cf9..5b6282b7d 100644 --- a/pkg/cmd/attestation/test/path.go +++ b/pkg/cmd/attestation/test/path.go @@ -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 }