refactor: use stdlib filepath.FromSlash
This commit is contained in:
parent
0e01f9a0f9
commit
464880dd31
2 changed files with 4 additions and 6 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue