@@ -39,7 +39,7 @@ func prepareDB() (string, error) {
3939 return result , nil
4040}
4141
42- func openTempSQLite (t * testing.T ) ( * sql.DB , string ) {
42+ func openTempSQLite (t * testing.T ) * sql.DB {
4343 t .Helper ()
4444
4545 dbFile , err := prepareDB ()
@@ -50,12 +50,12 @@ func openTempSQLite(t *testing.T) (*sql.DB, string) {
5050 require .NoError (t , dbErr , "DB could not be opened" )
5151 t .Cleanup (func () { _ = db .Close () })
5252
53- return db , dbFile
53+ return db
5454}
5555
5656// TestMigration tests the happy flow.
5757func TestMigration (t * testing.T ) {
58- db , _ := openTempSQLite (t )
58+ db := openTempSQLite (t )
5959
6060 migrationsDir , migrationsDirErr := fs .Sub (testMigrationsDir , "testData" )
6161
@@ -71,7 +71,7 @@ func TestMigration(t *testing.T) {
7171
7272// TestMigrationUpdate tests the happy flow of updating on existing migrations.
7373func TestMigrationUpdate (t * testing.T ) {
74- db , _ := openTempSQLite (t )
74+ db := openTempSQLite (t )
7575
7676 migrationsDir , migrationsDirErr := fs .Sub (testMigrationsDir , "testData" )
7777
@@ -103,7 +103,7 @@ func (m TestMigrationImpl) Migrate(ctx context.Context, tx *sql.Tx) error {
103103
104104// TestWithMigrations tests the adding of migrations using WithMigrations.
105105func TestWithMigrations (t * testing.T ) {
106- db , _ := openTempSQLite (t )
106+ db := openTempSQLite (t )
107107
108108 runErr := dmorph .Run (t .Context (),
109109 db ,
@@ -123,7 +123,7 @@ func TestMigrationUnableToCreateMorpher(t *testing.T) {
123123
124124// TestMigrationTooOld tests what happens if the applied migrations are too old.
125125func TestMigrationTooOld (t * testing.T ) {
126- db , _ := openTempSQLite (t )
126+ db := openTempSQLite (t )
127127
128128 migrationsDir , migrationsDirErr := fs .Sub (testMigrationsDir , "testData" )
129129
@@ -146,7 +146,7 @@ func TestMigrationTooOld(t *testing.T) {
146146
147147// TestMigrationUnrelated0 tests what happens if the applied migrations are unrelated to existing ones.
148148func TestMigrationUnrelated0 (t * testing.T ) {
149- db , _ := openTempSQLite (t )
149+ db := openTempSQLite (t )
150150
151151 migrationsDir , migrationsDirErr := fs .Sub (testMigrationsDir , "testData" )
152152
@@ -169,7 +169,7 @@ func TestMigrationUnrelated0(t *testing.T) {
169169
170170// TestMigrationUnrelated1 tests what happens if the applied migrations are unrelated to existing ones.
171171func TestMigrationUnrelated1 (t * testing.T ) {
172- db , _ := openTempSQLite (t )
172+ db := openTempSQLite (t )
173173
174174 migrationsDir , migrationsDirErr := fs .Sub (testMigrationsDir , "testData" )
175175
@@ -193,7 +193,7 @@ func TestMigrationUnrelated1(t *testing.T) {
193193// TestMigrationAppliedUnordered tests the case, that somehow the migrations in the
194194// database are registered not in the order of their keys.
195195func TestMigrationAppliedUnordered (t * testing.T ) {
196- db , _ := openTempSQLite (t )
196+ db := openTempSQLite (t )
197197
198198 migrationsDir , migrationsDirErr := fs .Sub (testMigrationsDir , "testData" )
199199
@@ -380,7 +380,7 @@ func TestMigrationRunInvalid(t *testing.T) {
380380// TestMigrationRunInvalidCreate tests the behavior of running a migration
381381// with an invalid CreateTemplate in the dialect.
382382func TestMigrationRunInvalidCreate (t * testing.T ) {
383- db , _ := openTempSQLite (t )
383+ db := openTempSQLite (t )
384384
385385 dialect := dmorph .DialectSQLite ()
386386 dialect .CreateTemplate = "utter nonsense"
@@ -398,7 +398,7 @@ func TestMigrationRunInvalidCreate(t *testing.T) {
398398
399399// TestMigrationRunInvalidApplied tests the failure scenario where the AppliedTemplate of the dialect is invalid.
400400func TestMigrationRunInvalidApplied (t * testing.T ) {
401- db , _ := openTempSQLite (t )
401+ db := openTempSQLite (t )
402402
403403 dialect := dmorph .DialectSQLite ()
404404 dialect .AppliedTemplate = "utter nonsense"
@@ -416,7 +416,7 @@ func TestMigrationRunInvalidApplied(t *testing.T) {
416416
417417// TestMigrationApplyInvalidDB verifies that applying migrations to an invalid or closed database results in an error.
418418func TestMigrationApplyInvalidDB (t * testing.T ) {
419- db , _ := openTempSQLite (t )
419+ db := openTempSQLite (t )
420420
421421 morpher , morpherErr := dmorph .NewMorpher (
422422 dmorph .WithDialect (dmorph .DialectSQLite ()),
@@ -431,7 +431,7 @@ func TestMigrationApplyInvalidDB(t *testing.T) {
431431
432432// TestMigrationApplyUnableRegister tests the behavior when the migration registration fails due to an invalid template.
433433func TestMigrationApplyUnableRegister (t * testing.T ) {
434- db , _ := openTempSQLite (t )
434+ db := openTempSQLite (t )
435435
436436 morpher , morpherErr := dmorph .NewMorpher (
437437 dmorph .WithDialect (dmorph .DialectSQLite ()),
@@ -453,7 +453,7 @@ func TestMigrationApplyUnableRegister(t *testing.T) {
453453// TestMigrationApplyUnableCommit tests the scenario where a migration application fails
454454// due to inability to commit a transaction.
455455func TestMigrationApplyUnableCommit (t * testing.T ) {
456- db , _ := openTempSQLite (t )
456+ db := openTempSQLite (t )
457457
458458 morpher , morpherErr := dmorph .NewMorpher (
459459 dmorph .WithDialect (dmorph .DialectSQLite ()),
0 commit comments