refactor: use stdlib filepath.FromSlash
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user