Skip to content

Commit 42cb688

Browse files
committed
Upgrade golangci-lint configuration and fix some linter issues
1 parent 838d1cb commit 42cb688

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

.golangci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
issues:
2-
exclude:
3-
- "SA1019: .* has been deprecated since Go 1.*: Drivers should implement .*"
1+
version: 2
2+
linters:
3+
exclusions:
4+
rules:
5+
- linters:
6+
- staticcheck
7+
text: "SA1019: .* has been deprecated since Go 1.*: Drivers should implement .*" # TODO: upgrade Go version, and drop these functions?

conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (c wrappedParentConn) BeginTx(ctx context.Context, opts driver.TxOptions) (
129129
case <-ctx.Done():
130130
return nil, ctx.Err()
131131
default:
132-
return c.Conn.Begin()
132+
return c.Begin()
133133
}
134134
}
135135

@@ -142,7 +142,7 @@ func (c wrappedParentConn) PrepareContext(ctx context.Context, query string) (dr
142142
case <-ctx.Done():
143143
return nil, ctx.Err()
144144
default:
145-
return c.Conn.Prepare(query)
145+
return c.Prepare(query)
146146
}
147147
}
148148

conn_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func TestConnQueryContext_PassWrappedRowContext(t *testing.T) {
124124
}
125125

126126
rows.Next()
127-
rows.Close()
127+
_ = rows.Close()
128128

129129
if !ti.RowsCloseValid {
130130
t.Error("RowsClose context not valid")
@@ -169,7 +169,7 @@ func TestConnPrepareContext_PassWrappedStmtContext(t *testing.T) {
169169
t.Fatalf("Prepare failed: %s", err)
170170
}
171171

172-
stmt.Close()
172+
_ = stmt.Close()
173173

174174
if !ti.StmtCloseValid {
175175
t.Error("StmtClose context not valid")

stmt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (s wrappedParentStmt) QueryContext(ctx context.Context, args []driver.Named
8989
case <-ctx.Done():
9090
return nil, ctx.Err()
9191
}
92-
return s.Stmt.Query(dargs)
92+
return s.Query(dargs)
9393
}
9494

9595
func (s wrappedParentStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error) {
@@ -106,5 +106,5 @@ func (s wrappedParentStmt) ExecContext(ctx context.Context, args []driver.NamedV
106106
case <-ctx.Done():
107107
return nil, ctx.Err()
108108
}
109-
return s.Stmt.Exec(dargs)
109+
return s.Exec(dargs)
110110
}

stmt_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func TestStmtQueryContext_PassWrappedRowContext(t *testing.T) {
8989
}
9090

9191
rows.Next()
92-
rows.Close()
93-
stmt.Close()
92+
_ = rows.Close()
93+
_ = stmt.Close()
9494

9595
if !ti.RowsNextValid {
9696
t.Error("RowsNext context not valid")

0 commit comments

Comments
 (0)