diff --git a/adapter/mysql/adapter_test.go b/adapter/mysql/adapter_test.go index 3a7dd5f..f933a8a 100644 --- a/adapter/mysql/adapter_test.go +++ b/adapter/mysql/adapter_test.go @@ -28,13 +28,13 @@ func withDatabase(callback func(*Adapter)) { config.User = os.Getenv("MYSQL_USER") config.Passwd = os.Getenv("MYSQL_PASSWORD") config.DBName = os.Getenv("MYSQL_DATABASE") - adapter, close, err := NewAdapter(config) + adapter, closeDatabase, err := NewAdapter(config) if err != nil { panic(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck adapter.db.MustExec("DROP TABLE IF EXISTS followers;") adapter.db.MustExec("DROP TABLE IF EXISTS articles;") diff --git a/adapter/oracle/adapter_test.go b/adapter/oracle/adapter_test.go index 33f0caa..b19cd5f 100644 --- a/adapter/oracle/adapter_test.go +++ b/adapter/oracle/adapter_test.go @@ -26,13 +26,13 @@ func withDatabase(callback func(*Adapter)) { config.Username = os.Getenv("ORACLE_USER") config.Password = os.Getenv("ORACLE_PASSWORD") config.ServiceName = os.Getenv("ORACLE_SERVICE") - adapter, close, err := NewAdapter(config) + adapter, closeDatabase, err := NewAdapter(config) if err != nil { panic(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck // adapter.db.MustExec("DROP TABLE followers") // adapter.db.MustExec("DROP TABLE articles") diff --git a/adapter/postgresql/adapter_test.go b/adapter/postgresql/adapter_test.go index 2b2b1bf..fc03784 100644 --- a/adapter/postgresql/adapter_test.go +++ b/adapter/postgresql/adapter_test.go @@ -26,13 +26,13 @@ func withDatabase(callback func(*Adapter)) { config.User = os.Getenv("POSTGRES_USER") config.Password = os.Getenv("POSTGRES_PASSWORD") config.DBName = os.Getenv("POSTGRES_DATABASE") - adapter, close, err := NewAdapter(config) + adapter, closeDatabase, err := NewAdapter(config) if err != nil { panic(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck adapter.db.MustExec("DROP TABLE IF EXISTS followers;") adapter.db.MustExec("DROP TABLE IF EXISTS articles;") diff --git a/adapter/sqlite3/adapter_test.go b/adapter/sqlite3/adapter_test.go index a9aec2f..e129880 100644 --- a/adapter/sqlite3/adapter_test.go +++ b/adapter/sqlite3/adapter_test.go @@ -8,13 +8,13 @@ import ( ) func withDatabase(callback func(*Adapter)) { - adapter, close, err := NewAdapter("file::memory:?cache=shared") + adapter, closeDatabase, err := NewAdapter("file::memory:?cache=shared") if err != nil { panic(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck adapter.DB.MustExec("PRAGMA foreign_keys = ON;") diff --git a/cmd/plant_erd-oracle/main.go b/cmd/plant_erd-oracle/main.go index 507fc77..727ae1f 100644 --- a/cmd/plant_erd-oracle/main.go +++ b/cmd/plant_erd-oracle/main.go @@ -69,13 +69,13 @@ func main() { ) app.Action = func(_ *cli.Context) error { - adapter, close, err := oracle.NewAdapter(oracleConfig) + adapter, closeDatabase, err := oracle.NewAdapter(oracleConfig) if err != nil { return errors.WithStack(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck schema, err := lib.LoadSchema(adapter) if err != nil { diff --git a/cmd/plant_erd/main.go b/cmd/plant_erd/main.go index a9a9675..86d609d 100644 --- a/cmd/plant_erd/main.go +++ b/cmd/plant_erd/main.go @@ -54,13 +54,13 @@ func main() { }, ), Action: func(_ *cli.Context) error { - adapter, close, err := sqlite3.NewAdapter(sqlite3Database) + adapter, closeDatabase, err := sqlite3.NewAdapter(sqlite3Database) if err != nil { return errors.WithStack(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck schema, err := lib.LoadSchema(adapter) if err != nil { @@ -122,13 +122,13 @@ func main() { mysqlConfig.Net = "tcp" mysqlConfig.Addr = fmt.Sprintf("%s:%d", mysqlHost, mysqlPort) - adapter, close, err := mysql.NewAdapter(mysqlConfig) + adapter, closeDatabase, err := mysql.NewAdapter(mysqlConfig) if err != nil { return errors.WithStack(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck schema, err := lib.LoadSchema(adapter) if err != nil { @@ -186,13 +186,13 @@ func main() { }, ), Action: func(_ *cli.Context) error { - adapter, close, err := postgresql.NewAdapter(postgresqlConfig) + adapter, closeDatabase, err := postgresql.NewAdapter(postgresqlConfig) if err != nil { return errors.WithStack(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck schema, err := lib.LoadSchema(adapter) if err != nil { diff --git a/lib/erd_generator_test.go b/lib/erd_generator_test.go index f273c90..8114bc2 100644 --- a/lib/erd_generator_test.go +++ b/lib/erd_generator_test.go @@ -14,13 +14,13 @@ import ( ) func withDatabase(callback func(*sqlite3.Adapter)) { - adapter, close, err := sqlite3.NewAdapter("file::memory:?cache=shared") + adapter, closeDatabase, err := sqlite3.NewAdapter("file::memory:?cache=shared") if err != nil { panic(err) } - defer close() //nolint:errcheck + defer closeDatabase() //nolint:errcheck adapter.DB.MustExec("PRAGMA foreign_keys = ON;")