Skip to content

Commit 78b8868

Browse files
authored
Remove unnecessary adapter type casting (#1)
1 parent 652ce4b commit 78b8868

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

postgres_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func dsn() string {
3030
func TestAdapter_specs(t *testing.T) {
3131
adapter, err := Open(dsn())
3232
assert.Nil(t, err)
33-
defer adapter.(*Postgres).Close()
33+
defer adapter.Close()
3434

3535
repo := rel.New(adapter)
3636

@@ -104,23 +104,23 @@ func TestAdapter_specs(t *testing.T) {
104104
func TestAdapter_Transaction_commitError(t *testing.T) {
105105
adapter, err := Open(dsn())
106106
assert.Nil(t, err)
107-
defer adapter.(*Postgres).Close()
107+
defer adapter.Close()
108108

109109
assert.NotNil(t, adapter.Commit(ctx))
110110
}
111111

112112
func TestAdapter_Transaction_rollbackError(t *testing.T) {
113113
adapter, err := Open(dsn())
114114
assert.Nil(t, err)
115-
defer adapter.(*Postgres).Close()
115+
defer adapter.Close()
116116

117117
assert.NotNil(t, adapter.Rollback(ctx))
118118
}
119119

120120
func TestAdapter_Exec_error(t *testing.T) {
121121
adapter, err := Open(dsn())
122122
assert.Nil(t, err)
123-
defer adapter.(*Postgres).Close()
123+
defer adapter.Close()
124124

125125
_, _, err = adapter.Exec(ctx, "error", nil)
126126
assert.NotNil(t, err)

0 commit comments

Comments
 (0)