Skip to content

🎧 Your Personal Streaming Service

refactor: use stdlib `filepath.FromSlash`

Deluan464880dd3193
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)
}