Skip to content

Commit b784fdb

Browse files
Fix linting issues
1 parent 42714a1 commit b784fdb

10 files changed

Lines changed: 10 additions & 10 deletions

collector/pg_long_running_transactions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (PGLongRunningTransactionsCollector) Update(ctx context.Context, instance *
6666
if err != nil {
6767
return err
6868
}
69-
defer rows.Close()
69+
defer func() { _ = rows.Close() }()
7070

7171
for rows.Next() {
7272
var transactions, ageInSeconds float64

collector/pg_replication_slot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (PGReplicationSlotCollector) Update(ctx context.Context, instance *instance
8484
if err != nil {
8585
return err
8686
}
87-
defer rows.Close()
87+
defer func() { _ = rows.Close() }()
8888

8989
for rows.Next() {
9090
var slotName sql.NullString

collector/pg_stat_activity_autovacuum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (PGStatActivityAutovacuumCollector) Update(ctx context.Context, instance *i
6161
if err != nil {
6262
return err
6363
}
64-
defer rows.Close()
64+
defer func() { _ = rows.Close() }()
6565

6666
for rows.Next() {
6767
var relname string

collector/pg_stat_database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func (c *PGStatDatabaseCollector) Update(ctx context.Context, instance *instance
250250
if err != nil {
251251
return err
252252
}
253-
defer rows.Close()
253+
defer func() { _ = rows.Close() }()
254254

255255
for rows.Next() {
256256
var datid, datname sql.NullString

collector/pg_stat_statements.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (PGStatStatementsCollector) Update(ctx context.Context, instance *instance,
126126
if err != nil {
127127
return err
128128
}
129-
defer rows.Close()
129+
defer func() { _ = rows.Close() }()
130130
for rows.Next() {
131131
var user, datname, queryid sql.NullString
132132
var callsTotal, rowsTotal sql.NullInt64

collector/pg_stat_user_tables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (c *PGStatUserTablesCollector) Update(ctx context.Context, instance *instan
193193
if err != nil {
194194
return err
195195
}
196-
defer rows.Close()
196+
defer func() { _ = rows.Close() }()
197197

198198
for rows.Next() {
199199
var datname, schemaname, relname sql.NullString

collector/pg_stat_walreceiver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (c *PGStatWalReceiverCollector) Update(ctx context.Context, instance *insta
141141
if err != nil {
142142
return err
143143
}
144-
defer rows.Close()
144+
defer func() { _ = rows.Close() }()
145145
for rows.Next() {
146146
var upstreamHost, slotName, status sql.NullString
147147
var receiveStartLsn, receiveStartTli, flushedLsn, receivedTli, latestEndLsn, upstreamNode sql.NullInt64

collector/pg_statio_user_indexes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (c *PGStatioUserIndexesCollector) Update(ctx context.Context, instance *ins
6767
if err != nil {
6868
return err
6969
}
70-
defer rows.Close()
70+
defer func() { _ = rows.Close() }()
7171
for rows.Next() {
7272
var schemaname, relname, indexrelname sql.NullString
7373
var idxBlksRead, idxBlksHit sql.NullFloat64

collector/pg_statio_user_tables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (PGStatIOUserTablesCollector) Update(ctx context.Context, instance *instanc
108108
if err != nil {
109109
return err
110110
}
111-
defer rows.Close()
111+
defer func() { _ = rows.Close() }()
112112

113113
for rows.Next() {
114114
var datname, schemaname, relname sql.NullString

collector/pg_xlog_location.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func (c PGXlogLocationCollector) Update(ctx context.Context, instance *instance,
6969
if err != nil {
7070
return err
7171
}
72-
defer rows.Close()
72+
defer func() { _ = rows.Close() }()
7373

7474
for rows.Next() {
7575
var bytes float64

0 commit comments

Comments
 (0)