Skip to content

Commit 6100f36

Browse files
committed
fixed linter issues
1 parent 2a9dcfe commit 6100f36

File tree

1 file changed

+5
-1
lines changed
  • examples/transaction/database/sql

1 file changed

+5
-1
lines changed

examples/transaction/database/sql/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func txWithoutRetries(ctx context.Context, db *sql.DB) (words []string, _ error)
8686
if err != nil {
8787
return nil, err
8888
}
89-
defer tx.Rollback()
89+
defer tx.Rollback() //nolint:errcheck
9090

9191
row := tx.QueryRowContext(ctx, "SELECT 'execute';")
9292

@@ -118,6 +118,8 @@ func txWithoutRetries(ctx context.Context, db *sql.DB) (words []string, _ error)
118118
return nil, err
119119
}
120120

121+
defer rows.Close() //nolint:errcheck
122+
121123
for rows.Next() {
122124
var (
123125
word string
@@ -178,6 +180,8 @@ func txWithRetries(ctx context.Context, db *sql.DB) (words []string, _ error) {
178180
return err
179181
}
180182

183+
defer rows.Close() //nolint:errcheck
184+
181185
for rows.Next() {
182186
var (
183187
word string

0 commit comments

Comments
 (0)