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))
if err != nil {
return false
}
return true
return err == nil
}
func monitorPid(pid int) {

View File

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

View File

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

View File

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