refactor: use stdlib filepath.FromSlash

This commit is contained in:
Deluan
2020-02-02 20:33:58 -05:00
committed by Deluan Quintão
parent 0e01f9a0f9
commit 464880dd31
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -2,8 +2,7 @@ package persistence
import ( import (
"context" "context"
"os" "path/filepath"
"strings"
"testing" "testing"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
@@ -79,7 +78,7 @@ var (
) )
func P(path string) string { func P(path string) string {
return strings.ReplaceAll(path, "/", string(os.PathSeparator)) return filepath.FromSlash(path)
} }
var _ = Describe("Initialize test DB", func() { var _ = Describe("Initialize test DB", func() {
+2 -3
View File
@@ -1,8 +1,7 @@
package scanner package scanner
import ( import (
"os" "path/filepath"
"strings"
"testing" "testing"
"github.com/deluan/navidrome/log" "github.com/deluan/navidrome/log"
@@ -19,5 +18,5 @@ func TestScanner(t *testing.T) {
} }
func P(path string) string { func P(path string) string {
return strings.ReplaceAll(path, "/", string(os.PathSeparator)) return filepath.FromSlash(path)
} }