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

View File

@ -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() {

View File

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