1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-09-16 08:56:19 +02:00

Passing an initial golangci-lint pass

This commit is contained in:
Jesús Espino
2020-10-18 02:07:35 +02:00
parent e6a9333987
commit 53b051816c
4 changed files with 14 additions and 11 deletions

View File

@@ -22,11 +22,7 @@ func isProcessRunning(pid int) bool {
} }
err = process.Signal(syscall.Signal(0)) err = process.Signal(syscall.Signal(0))
if err != nil { return err == nil
return false
}
return true
} }
func monitorPid(pid int) { func monitorPid(pid int) {

View File

@@ -64,10 +64,11 @@ func New(config *config.Configuration) (*Server, error) {
}() }()
return &Server{ return &Server{
config: config, config: config,
wsServer: wsServer, wsServer: wsServer,
webServer: webServer, webServer: webServer,
store: store, store: store,
filesBackend: filesBackend,
}, nil }, nil
} }

View File

@@ -21,7 +21,9 @@ func (s *SQLStore) Migrate() error {
var bresource *bindata.AssetSource var bresource *bindata.AssetSource
if s.dbType == "sqlite3" { if s.dbType == "sqlite3" {
driver, err = sqlite3.WithInstance(s.db, &sqlite3.Config{}) driver, err = sqlite3.WithInstance(s.db, &sqlite3.Config{})
fmt.Println(pgmigrations.AssetNames()) if err != nil {
return err
}
bresource = bindata.Resource(sqlite.AssetNames(), bresource = bindata.Resource(sqlite.AssetNames(),
func(name string) ([]byte, error) { func(name string) ([]byte, error) {
return sqlite.Asset(name) return sqlite.Asset(name)
@@ -29,6 +31,9 @@ func (s *SQLStore) Migrate() error {
} }
if s.dbType == "postgres" { if s.dbType == "postgres" {
driver, err = postgres.WithInstance(s.db, &postgres.Config{}) driver, err = postgres.WithInstance(s.db, &postgres.Config{})
if err != nil {
return err
}
bresource = bindata.Resource(pgmigrations.AssetNames(), bresource = bindata.Resource(pgmigrations.AssetNames(),
func(name string) ([]byte, error) { func(name string) ([]byte, error) {
return pgmigrations.Asset(name) return pgmigrations.Asset(name)

View File

@@ -21,7 +21,8 @@ func SetupTests(t *testing.T) (*SQLStore, func()) {
require.Nil(t, err) require.Nil(t, err)
tearDown := func() { tearDown := func() {
store.Shutdown() err = store.Shutdown()
require.Nil(t, err)
} }
return store, tearDown return store, tearDown
} }