From 464880dd31931a2a2ed776f005399772c78e9734 Mon Sep 17 00:00:00 2001 From: Deluan <deluan@deluan.com> Date: Sun, 2 Feb 2020 20:33:58 -0500 Subject: [PATCH] refactor: use stdlib `filepath.FromSlash` --- persistence/persistence_suite_test.go | 5 ++--- scanner/scanner_suite_test.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/persistence/persistence_suite_test.go b/persistence/persistence_suite_test.go index 9fa315cd3..a4a216fb8 100644 --- a/persistence/persistence_suite_test.go +++ b/persistence/persistence_suite_test.go @@ -2,8 +2,7 @@ package persistence import ( "context" - "os" - "strings" + "path/filepath" "testing" "github.com/astaxie/beego/orm" @@ -79,7 +78,7 @@ var ( ) func P(path string) string { - return strings.ReplaceAll(path, "/", string(os.PathSeparator)) + return filepath.FromSlash(path) } var _ = Describe("Initialize test DB", func() { diff --git a/scanner/scanner_suite_test.go b/scanner/scanner_suite_test.go index af9fa41f8..3f2cf7db2 100644 --- a/scanner/scanner_suite_test.go +++ b/scanner/scanner_suite_test.go @@ -1,8 +1,7 @@ package scanner import ( - "os" - "strings" + "path/filepath" "testing" "github.com/deluan/navidrome/log" @@ -19,5 +18,5 @@ func TestScanner(t *testing.T) { } func P(path string) string { - return strings.ReplaceAll(path, "/", string(os.PathSeparator)) + return filepath.FromSlash(path) }