Use path rather than filepath for embedded files (#21896)

Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
Этот коммит содержится в:
Tim Scheuermann
2022-12-20 08:59:40 +01:00
коммит произвёл GitHub
родитель 79193240e9
Коммит 0ce7c5e3da

Просмотреть файл

@@ -9,7 +9,7 @@ import (
dbsql "database/sql" dbsql "database/sql"
"fmt" "fmt"
"log" "log"
"path/filepath" "path"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@@ -1041,7 +1041,7 @@ func (ss *SqlStore) hasLicense() bool {
func (ss *SqlStore) migrate(direction migrationDirection) error { func (ss *SqlStore) migrate(direction migrationDirection) error {
assets := db.Assets() assets := db.Assets()
assetsList, err := assets.ReadDir(filepath.Join("migrations", ss.DriverName())) assetsList, err := assets.ReadDir(path.Join("migrations", ss.DriverName()))
if err != nil { if err != nil {
return err return err
} }
@@ -1054,7 +1054,7 @@ func (ss *SqlStore) migrate(direction migrationDirection) error {
src, err := mbindata.WithInstance(&mbindata.AssetSource{ src, err := mbindata.WithInstance(&mbindata.AssetSource{
Names: assetNamesForDriver, Names: assetNamesForDriver,
AssetFunc: func(name string) ([]byte, error) { AssetFunc: func(name string) ([]byte, error) {
return assets.ReadFile(filepath.Join("migrations", ss.DriverName(), name)) return assets.ReadFile(path.Join("migrations", ss.DriverName(), name))
}, },
}) })
if err != nil { if err != nil {