Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
linters:
enable:
- misspell
- revive

issues:
Expand All @@ -14,3 +15,9 @@ linters-settings:
exclude-functions:
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
severity: warning
disabled: true
5 changes: 1 addition & 4 deletions collector/pg_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ func (c PGDatabaseCollector) Update(ctx context.Context, instance *instance, ch
prometheus.GaugeValue, sizeMetric, datname,
)
}
if err := rows.Err(); err != nil {
return err
}
return nil
return rows.Err()
}

func sliceContains(slice []string, s string) bool {
Expand Down
5 changes: 1 addition & 4 deletions collector/pg_replication_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,5 @@ func (PGReplicationSlotCollector) Update(ctx context.Context, instance *instance
prometheus.GaugeValue, isActiveValue, slotNameLabel,
)
}
if err := rows.Err(); err != nil {
return err
}
return nil
return rows.Err()
}
5 changes: 1 addition & 4 deletions collector/pg_statio_user_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,5 @@ func (PGStatIOUserTablesCollector) Update(ctx context.Context, instance *instanc
datnameLabel, schemanameLabel, relnameLabel,
)
}
if err := rows.Err(); err != nil {
return err
}
return nil
return rows.Err()
}