Use path rather than filepath for embedded files (#21896)
Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
79193240e9
Коммит
0ce7c5e3da
@@ -9,7 +9,7 @@ import (
|
||||
dbsql "database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -1041,7 +1041,7 @@ func (ss *SqlStore) hasLicense() bool {
|
||||
func (ss *SqlStore) migrate(direction migrationDirection) error {
|
||||
assets := db.Assets()
|
||||
|
||||
assetsList, err := assets.ReadDir(filepath.Join("migrations", ss.DriverName()))
|
||||
assetsList, err := assets.ReadDir(path.Join("migrations", ss.DriverName()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -1054,7 +1054,7 @@ func (ss *SqlStore) migrate(direction migrationDirection) error {
|
||||
src, err := mbindata.WithInstance(&mbindata.AssetSource{
|
||||
Names: assetNamesForDriver,
|
||||
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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user