diff --git a/Makefile b/Makefile index b85da9d68f..b7c644c585 100644 --- a/Makefile +++ b/Makefile @@ -270,9 +270,9 @@ migrations-bindata: ## Generates bindata migrations @echo Generating bindata for migrations $(GO) generate $(GOFLAGS) ./db/migrations/ -filesstore-mocks: ## Creates mock files. +filestore-mocks: ## Creates mock files. $(GO) get -modfile=go.tools.mod github.com/vektra/mockery/... - $(GOBIN)/mockery -dir services/filesstore -all -output services/filesstore/mocks -note 'Regenerate this file using `make filesstore-mocks`.' + $(GOBIN)/mockery -dir shared/filestore -all -output shared/filestore/mocks -note 'Regenerate this file using `make filestore-mocks`.' ldap-mocks: ## Creates mock files for ldap. $(GO) get -modfile=go.tools.mod github.com/vektra/mockery/... diff --git a/api4/system.go b/api4/system.go index 8541a8c206..543926689a 100644 --- a/api4/system.go +++ b/api4/system.go @@ -172,7 +172,7 @@ func getSystemPing(c *Context, w http.ResponseWriter, r *http.Request) { filestoreStatusKey := "filestore_status" s[filestoreStatusKey] = model.STATUS_OK - appErr := c.App.TestFilesStoreConnection() + appErr := c.App.TestFileStoreConnection() if appErr != nil { s[filestoreStatusKey] = model.STATUS_UNHEALTHY s[model.STATUS] = model.STATUS_UNHEALTHY @@ -450,7 +450,7 @@ func testS3(c *Context, w http.ResponseWriter, r *http.Request) { cfg.FileSettings.AmazonS3SecretAccessKey = c.App.Config().FileSettings.AmazonS3SecretAccessKey } - appErr := c.App.TestFilesStoreConnectionWithConfig(&cfg.FileSettings) + appErr := c.App.TestFileStoreConnectionWithConfig(&cfg.FileSettings) if appErr != nil { c.Err = appErr return diff --git a/app/app_iface.go b/app/app_iface.go index 8057b38300..49f525152b 100644 --- a/app/app_iface.go +++ b/app/app_iface.go @@ -23,11 +23,11 @@ import ( "github.com/mattermost/mattermost-server/v5/mlog" "github.com/mattermost/mattermost-server/v5/model" "github.com/mattermost/mattermost-server/v5/plugin" - "github.com/mattermost/mattermost-server/v5/services/filesstore" "github.com/mattermost/mattermost-server/v5/services/httpservice" "github.com/mattermost/mattermost-server/v5/services/imageproxy" "github.com/mattermost/mattermost-server/v5/services/searchengine" "github.com/mattermost/mattermost-server/v5/services/timezones" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/shared/i18n" "github.com/mattermost/mattermost-server/v5/store" ) @@ -48,7 +48,7 @@ type AppIface interface { // AddPublicKey will add plugin public key to the config. Overwrites the previous file AddPublicKey(name string, key io.Reader) *model.AppError // Caller must close the first return value - FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) + FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) // ChannelMembersMinusGroupMembers returns the set of users in the given channel minus the set of users in the given // groups. // @@ -312,7 +312,7 @@ type AppIface interface { DoAdvancedPermissionsMigration() // This function zip's up all the files in fileDatas array and then saves it to the directory specified with the specified zip file name // Ensure the zip file name ends with a .zip - CreateZipFileAndAddFiles(fileBackend filesstore.FileBackend, fileDatas []model.FileData, zipFileName, directory string) error + CreateZipFileAndAddFiles(fileBackend filestore.FileBackend, fileDatas []model.FileData, zipFileName, directory string) error // This to be used for places we check the users password when they are already logged in DoubleCheckPassword(user *model.User, password string) *model.AppError // UpdateBotActive marks a bot as active or inactive, along with its corresponding user. @@ -502,7 +502,7 @@ type AppIface interface { EnvironmentConfig() map[string]interface{} ExportPermissions(w io.Writer) error FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError) - FileBackend() (filesstore.FileBackend, *model.AppError) + FileBackend() (filestore.FileBackend, *model.AppError) FileExists(path string) (bool, *model.AppError) FileModTime(path string) (time.Time, *model.AppError) FileSize(path string) (int64, *model.AppError) @@ -974,8 +974,8 @@ type AppIface interface { TelemetryId() string TestElasticsearch(cfg *model.Config) *model.AppError TestEmail(userID string, cfg *model.Config) *model.AppError - TestFilesStoreConnection() *model.AppError - TestFilesStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError + TestFileStoreConnection() *model.AppError + TestFileStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError TestLdap() *model.AppError TestSiteURL(siteURL string) *model.AppError Timezones() *timezones.Timezones diff --git a/app/file.go b/app/file.go index 3c66c1121c..9fa8555ad3 100644 --- a/app/file.go +++ b/app/file.go @@ -37,7 +37,7 @@ import ( "github.com/mattermost/mattermost-server/v5/model" "github.com/mattermost/mattermost-server/v5/plugin" "github.com/mattermost/mattermost-server/v5/services/docextractor" - "github.com/mattermost/mattermost-server/v5/services/filesstore" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/store" "github.com/mattermost/mattermost-server/v5/utils" ) @@ -76,7 +76,7 @@ const ( ImagePreviewPixelWidth = 1920 ) -func (a *App) FileBackend() (filesstore.FileBackend, *model.AppError) { +func (a *App) FileBackend() (filestore.FileBackend, *model.AppError) { return a.Srv().FileBackend() } @@ -89,7 +89,7 @@ func (a *App) CheckMandatoryS3Fields(settings *model.FileSettings) *model.AppErr return nil } -func (a *App) TestFilesStoreConnection() *model.AppError { +func (a *App) TestFileStoreConnection() *model.AppError { backend, err := a.FileBackend() if err != nil { return err @@ -101,9 +101,9 @@ func (a *App) TestFilesStoreConnection() *model.AppError { return nil } -func (a *App) TestFilesStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError { +func (a *App) TestFileStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError { license := a.Srv().License() - backend, err := filesstore.NewFileBackend(cfg.ToFileBackendSettings(license != nil && *license.Features.Compliance)) + backend, err := filestore.NewFileBackend(cfg.ToFileBackendSettings(license != nil && *license.Features.Compliance)) if err != nil { return model.NewAppError("FileBackend", "api.file.no_driver.app_error", nil, err.Error(), http.StatusInternalServerError) } @@ -127,7 +127,7 @@ func (a *App) ReadFile(path string) ([]byte, *model.AppError) { } // Caller must close the first return value -func (a *App) FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) { +func (a *App) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) { backend, err := a.FileBackend() if err != nil { return nil, err @@ -1310,7 +1310,7 @@ func (a *App) CopyFileInfos(userID string, fileIDs []string) ([]string, *model.A // This function zip's up all the files in fileDatas array and then saves it to the directory specified with the specified zip file name // Ensure the zip file name ends with a .zip -func (a *App) CreateZipFileAndAddFiles(fileBackend filesstore.FileBackend, fileDatas []model.FileData, zipFileName, directory string) error { +func (a *App) CreateZipFileAndAddFiles(fileBackend filestore.FileBackend, fileDatas []model.FileData, zipFileName, directory string) error { // Create Zip File (temporarily stored on disk) conglomerateZipFile, err := os.Create(zipFileName) if err != nil { diff --git a/app/file_test.go b/app/file_test.go index 82cc2b31b5..6d814e1afb 100644 --- a/app/file_test.go +++ b/app/file_test.go @@ -17,8 +17,8 @@ import ( "github.com/stretchr/testify/require" "github.com/mattermost/mattermost-server/v5/model" - filesStoreMocks "github.com/mattermost/mattermost-server/v5/services/filesstore/mocks" "github.com/mattermost/mattermost-server/v5/services/searchengine/mocks" + filesStoreMocks "github.com/mattermost/mattermost-server/v5/shared/filestore/mocks" "github.com/mattermost/mattermost-server/v5/utils/fileutils" ) diff --git a/app/opentracing/opentracing_layer.go b/app/opentracing/opentracing_layer.go index 054e367fe3..17c49a15b3 100644 --- a/app/opentracing/opentracing_layer.go +++ b/app/opentracing/opentracing_layer.go @@ -24,12 +24,12 @@ import ( "github.com/mattermost/mattermost-server/v5/mlog" "github.com/mattermost/mattermost-server/v5/model" "github.com/mattermost/mattermost-server/v5/plugin" - "github.com/mattermost/mattermost-server/v5/services/filesstore" "github.com/mattermost/mattermost-server/v5/services/httpservice" "github.com/mattermost/mattermost-server/v5/services/imageproxy" "github.com/mattermost/mattermost-server/v5/services/searchengine" "github.com/mattermost/mattermost-server/v5/services/timezones" "github.com/mattermost/mattermost-server/v5/services/tracing" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/shared/i18n" "github.com/mattermost/mattermost-server/v5/store" "github.com/opentracing/opentracing-go/ext" @@ -2415,7 +2415,7 @@ func (a *OpenTracingAppLayer) CreateWebhookPost(userID string, channel *model.Ch return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) CreateZipFileAndAddFiles(fileBackend filesstore.FileBackend, fileDatas []model.FileData, zipFileName string, directory string) error { +func (a *OpenTracingAppLayer) CreateZipFileAndAddFiles(fileBackend filestore.FileBackend, fileDatas []model.FileData, zipFileName string, directory string) error { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateZipFileAndAddFiles") @@ -3688,7 +3688,7 @@ func (a *OpenTracingAppLayer) FetchSamlMetadataFromIdp(url string) ([]byte, *mod return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) FileBackend() (filesstore.FileBackend, *model.AppError) { +func (a *OpenTracingAppLayer) FileBackend() (filestore.FileBackend, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileBackend") @@ -3754,7 +3754,7 @@ func (a *OpenTracingAppLayer) FileModTime(path string) (time.Time, *model.AppErr return resultVar0, resultVar1 } -func (a *OpenTracingAppLayer) FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) { +func (a *OpenTracingAppLayer) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) { origCtx := a.ctx span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileReader") @@ -14602,9 +14602,9 @@ func (a *OpenTracingAppLayer) TestEmail(userID string, cfg *model.Config) *model return resultVar0 } -func (a *OpenTracingAppLayer) TestFilesStoreConnection() *model.AppError { +func (a *OpenTracingAppLayer) TestFileStoreConnection() *model.AppError { origCtx := a.ctx - span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFilesStoreConnection") + span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFileStoreConnection") a.ctx = newCtx a.app.Srv().Store.SetContext(newCtx) @@ -14614,7 +14614,7 @@ func (a *OpenTracingAppLayer) TestFilesStoreConnection() *model.AppError { }() defer span.Finish() - resultVar0 := a.app.TestFilesStoreConnection() + resultVar0 := a.app.TestFileStoreConnection() if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) @@ -14624,9 +14624,9 @@ func (a *OpenTracingAppLayer) TestFilesStoreConnection() *model.AppError { return resultVar0 } -func (a *OpenTracingAppLayer) TestFilesStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError { +func (a *OpenTracingAppLayer) TestFileStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError { origCtx := a.ctx - span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFilesStoreConnectionWithConfig") + span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFileStoreConnectionWithConfig") a.ctx = newCtx a.app.Srv().Store.SetContext(newCtx) @@ -14636,7 +14636,7 @@ func (a *OpenTracingAppLayer) TestFilesStoreConnectionWithConfig(cfg *model.File }() defer span.Finish() - resultVar0 := a.app.TestFilesStoreConnectionWithConfig(cfg) + resultVar0 := a.app.TestFileStoreConnectionWithConfig(cfg) if resultVar0 != nil { span.LogFields(spanlog.Error(resultVar0)) diff --git a/app/plugin.go b/app/plugin.go index b7c136d249..e92b766af5 100644 --- a/app/plugin.go +++ b/app/plugin.go @@ -23,8 +23,8 @@ import ( "github.com/mattermost/mattermost-server/v5/mlog" "github.com/mattermost/mattermost-server/v5/model" "github.com/mattermost/mattermost-server/v5/plugin" - "github.com/mattermost/mattermost-server/v5/services/filesstore" "github.com/mattermost/mattermost-server/v5/services/marketplace" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/utils/fileutils" ) @@ -273,7 +273,7 @@ func (a *App) SyncPlugins() *model.AppError { } defer reader.Close() - var signature filesstore.ReadCloseSeeker + var signature filestore.ReadCloseSeeker if *a.Config().PluginSettings.RequirePluginSignature { signature, appErr = a.FileReader(plugin.signaturePath) if appErr != nil { diff --git a/app/plugin_install.go b/app/plugin_install.go index eab050b8dd..c828baeec3 100644 --- a/app/plugin_install.go +++ b/app/plugin_install.go @@ -50,7 +50,7 @@ import ( "github.com/mattermost/mattermost-server/v5/mlog" "github.com/mattermost/mattermost-server/v5/model" - "github.com/mattermost/mattermost-server/v5/services/filesstore" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/utils" ) @@ -82,7 +82,7 @@ func (a *App) InstallPluginFromData(data model.PluginEventData) { } defer reader.Close() - var signature filesstore.ReadCloseSeeker + var signature filestore.ReadCloseSeeker if *a.Config().PluginSettings.RequirePluginSignature { signature, appErr = a.FileReader(plugin.signaturePath) if appErr != nil { diff --git a/app/server.go b/app/server.go index 41e0785e14..682e642fe0 100644 --- a/app/server.go +++ b/app/server.go @@ -44,7 +44,6 @@ import ( "github.com/mattermost/mattermost-server/v5/plugin" "github.com/mattermost/mattermost-server/v5/services/awsmeter" "github.com/mattermost/mattermost-server/v5/services/cache" - "github.com/mattermost/mattermost-server/v5/services/filesstore" "github.com/mattermost/mattermost-server/v5/services/httpservice" "github.com/mattermost/mattermost-server/v5/services/imageproxy" "github.com/mattermost/mattermost-server/v5/services/mailservice" @@ -54,6 +53,7 @@ import ( "github.com/mattermost/mattermost-server/v5/services/timezones" "github.com/mattermost/mattermost-server/v5/services/tracing" "github.com/mattermost/mattermost-server/v5/services/upgrader" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/shared/i18n" "github.com/mattermost/mattermost-server/v5/store" "github.com/mattermost/mattermost-server/v5/store/localcachelayer" @@ -1573,9 +1573,9 @@ func (s *Server) stopSearchEngine() { } } -func (s *Server) FileBackend() (filesstore.FileBackend, *model.AppError) { +func (s *Server) FileBackend() (filestore.FileBackend, *model.AppError) { license := s.License() - backend, err := filesstore.NewFileBackend(s.Config().FileSettings.ToFileBackendSettings(license != nil && *license.Features.Compliance)) + backend, err := filestore.NewFileBackend(s.Config().FileSettings.ToFileBackendSettings(license != nil && *license.Features.Compliance)) if err != nil { return nil, model.NewAppError("FileBackend", "api.file.no_driver.app_error", nil, err.Error(), http.StatusInternalServerError) } diff --git a/model/config.go b/model/config.go index 3b9eb25c2c..77e06bcc87 100644 --- a/model/config.go +++ b/model/config.go @@ -21,7 +21,7 @@ import ( "github.com/mattermost/ldap" "github.com/mattermost/mattermost-server/v5/mlog" - "github.com/mattermost/mattermost-server/v5/services/filesstore" + "github.com/mattermost/mattermost-server/v5/shared/filestore" ) const ( @@ -1469,14 +1469,14 @@ func (s *FileSettings) SetDefaults(isUpdate bool) { } } -func (s *FileSettings) ToFileBackendSettings(enableComplianceFeature bool) filesstore.FileBackendSettings { +func (s *FileSettings) ToFileBackendSettings(enableComplianceFeature bool) filestore.FileBackendSettings { if *s.DriverName == IMAGE_DRIVER_LOCAL { - return filesstore.FileBackendSettings{ + return filestore.FileBackendSettings{ DriverName: *s.DriverName, Directory: *s.Directory, } } - return filesstore.FileBackendSettings{ + return filestore.FileBackendSettings{ DriverName: *s.DriverName, AmazonS3AccessKeyId: *s.AmazonS3AccessKeyId, AmazonS3SecretAccessKey: *s.AmazonS3SecretAccessKey, diff --git a/services/filesstore/filesstore.go b/shared/filestore/filesstore.go similarity index 99% rename from services/filesstore/filesstore.go rename to shared/filestore/filesstore.go index 02541b05e6..ef02895d55 100644 --- a/services/filesstore/filesstore.go +++ b/shared/filestore/filesstore.go @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -package filesstore +package filestore import ( "io" diff --git a/services/filesstore/filesstore_test.go b/shared/filestore/filesstore_test.go similarity index 99% rename from services/filesstore/filesstore_test.go rename to shared/filestore/filesstore_test.go index 2e49d1c5c4..8b45ea18ea 100644 --- a/services/filesstore/filesstore_test.go +++ b/shared/filestore/filesstore_test.go @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -package filesstore +package filestore import ( "bytes" diff --git a/services/filesstore/localstore.go b/shared/filestore/localstore.go similarity index 99% rename from services/filesstore/localstore.go rename to shared/filestore/localstore.go index 9c37e097dd..c100e87cb0 100644 --- a/services/filesstore/localstore.go +++ b/shared/filestore/localstore.go @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -package filesstore +package filestore import ( "bytes" diff --git a/services/filesstore/mocks/FileBackend.go b/shared/filestore/mocks/FileBackend.go similarity index 93% rename from services/filesstore/mocks/FileBackend.go rename to shared/filestore/mocks/FileBackend.go index 33dcf49e79..7679a85319 100644 --- a/services/filesstore/mocks/FileBackend.go +++ b/shared/filestore/mocks/FileBackend.go @@ -1,13 +1,13 @@ // Code generated by mockery v1.0.0. DO NOT EDIT. -// Regenerate this file using `make filesstore-mocks`. +// Regenerate this file using `make filestore-mocks`. package mocks import ( io "io" - filesstore "github.com/mattermost/mattermost-server/v5/services/filesstore" + filestore "github.com/mattermost/mattermost-server/v5/shared/filestore" mock "github.com/stretchr/testify/mock" @@ -178,15 +178,15 @@ func (_m *FileBackend) ReadFile(path string) ([]byte, error) { } // Reader provides a mock function with given fields: path -func (_m *FileBackend) Reader(path string) (filesstore.ReadCloseSeeker, error) { +func (_m *FileBackend) Reader(path string) (filestore.ReadCloseSeeker, error) { ret := _m.Called(path) - var r0 filesstore.ReadCloseSeeker - if rf, ok := ret.Get(0).(func(string) filesstore.ReadCloseSeeker); ok { + var r0 filestore.ReadCloseSeeker + if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok { r0 = rf(path) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(filesstore.ReadCloseSeeker) + r0 = ret.Get(0).(filestore.ReadCloseSeeker) } } diff --git a/services/filesstore/mocks/ReadCloseSeeker.go b/shared/filestore/mocks/ReadCloseSeeker.go similarity index 95% rename from services/filesstore/mocks/ReadCloseSeeker.go rename to shared/filestore/mocks/ReadCloseSeeker.go index 04c23c8c3e..113cd8cedd 100644 --- a/services/filesstore/mocks/ReadCloseSeeker.go +++ b/shared/filestore/mocks/ReadCloseSeeker.go @@ -1,6 +1,6 @@ // Code generated by mockery v1.0.0. DO NOT EDIT. -// Regenerate this file using `make filesstore-mocks`. +// Regenerate this file using `make filestore-mocks`. package mocks diff --git a/services/filesstore/s3_overrides.go b/shared/filestore/s3_overrides.go similarity index 98% rename from services/filesstore/s3_overrides.go rename to shared/filestore/s3_overrides.go index 975889fb7a..e7b29b98e8 100644 --- a/services/filesstore/s3_overrides.go +++ b/shared/filestore/s3_overrides.go @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -package filesstore +package filestore import ( "context" diff --git a/services/filesstore/s3store.go b/shared/filestore/s3store.go similarity index 99% rename from services/filesstore/s3store.go rename to shared/filestore/s3store.go index eefc3e0cca..4000f808a2 100644 --- a/services/filesstore/s3store.go +++ b/shared/filestore/s3store.go @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -package filesstore +package filestore import ( "context" @@ -371,7 +371,7 @@ func (b *S3FileBackend) ListDirectory(path string) ([]string, error) { path = filepath.Join(b.pathPrefix, path) if !strings.HasSuffix(path, "/") && path != "" { // s3Clnt returns only the path itself when "/" is not present - // appending "/" to make it consistent across all filesstores + // appending "/" to make it consistent across all filestores path = path + "/" } diff --git a/services/filesstore/s3store_test.go b/shared/filestore/s3store_test.go similarity index 97% rename from services/filesstore/s3store_test.go rename to shared/filestore/s3store_test.go index 5bcb2a3db7..d8b1fb69e8 100644 --- a/services/filesstore/s3store_test.go +++ b/shared/filestore/s3store_test.go @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -package filesstore +package filestore import ( "testing" diff --git a/testlib/resources.go b/testlib/resources.go index e51539f281..63fd347d17 100644 --- a/testlib/resources.go +++ b/testlib/resources.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" "github.com/mattermost/mattermost-server/v5/model" - "github.com/mattermost/mattermost-server/v5/services/filesstore" + "github.com/mattermost/mattermost-server/v5/shared/filestore" "github.com/mattermost/mattermost-server/v5/utils" "github.com/mattermost/mattermost-server/v5/utils/fileutils" ) @@ -119,7 +119,7 @@ func getTestResourcesToSetup() []testResourceDetails { } func CopyFile(src, dst string) error { - fileBackend, err := filesstore.NewFileBackend(filesstore.FileBackendSettings{DriverName: "local", Directory: ""}) + fileBackend, err := filestore.NewFileBackend(filestore.FileBackendSettings{DriverName: "local", Directory: ""}) if err != nil { return errors.Wrapf(err, "failed to copy file %s to %s", src, dst) }