Skip to content

Commit 4a8bc3c

Browse files
committed
fix lints
1 parent 6624157 commit 4a8bc3c

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

cmd/postgres_exporter/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// See the License for the specific language governing permissions and
1212
// limitations under the License.
1313

14+
//nolint:unused
1415
package postgres_exporter
1516

1617
import (
@@ -20,8 +21,6 @@ import (
2021
"strings"
2122

2223
"github.com/alecthomas/kingpin/v2"
23-
"github.com/prometheus-community/postgres_exporter/collector"
24-
"github.com/prometheus-community/postgres_exporter/config"
2524
"github.com/prometheus/client_golang/prometheus"
2625
cversion "github.com/prometheus/client_golang/prometheus/collectors/version"
2726
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -30,6 +29,9 @@ import (
3029
"github.com/prometheus/common/version"
3130
"github.com/prometheus/exporter-toolkit/web"
3231
"github.com/prometheus/exporter-toolkit/web/kingpinflag"
32+
33+
"github.com/prometheus-community/postgres_exporter/collector"
34+
"github.com/prometheus-community/postgres_exporter/config"
3335
)
3436

3537
var (

cmd/postgres_exporter/postgres_exporter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ func (e *ErrorConnectToServer) Error() string {
144144
}
145145

146146
// TODO: revisit this with the semver system
147+
//
148+
//nolint:unused
147149
func dumpMaps() {
148150
// TODO: make this function part of the exporter
149151
for name, cmap := range builtinMetricMaps {

cmd/postgres_exporter/probe.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ import (
1818
"log/slog"
1919
"net/http"
2020

21-
"github.com/prometheus-community/postgres_exporter/collector"
22-
"github.com/prometheus-community/postgres_exporter/config"
2321
"github.com/prometheus/client_golang/prometheus"
2422
"github.com/prometheus/client_golang/prometheus/promhttp"
23+
24+
"github.com/prometheus-community/postgres_exporter/collector"
25+
"github.com/prometheus-community/postgres_exporter/config"
2526
)
2627

28+
//nolint:unused
2729
func handleProbe(logger *slog.Logger, excludeDatabases []string) http.HandlerFunc {
2830
return func(w http.ResponseWriter, r *http.Request) {
2931
ctx := r.Context()

collector/collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func NewPostgresCollector(logger *slog.Logger, excludeDatabases []string, dsn st
117117
collectors := make(map[string]Collector)
118118
initiatedCollectorsMtx.Lock()
119119
defer initiatedCollectorsMtx.Unlock()
120-
for key, _ := range collectorsToStart {
120+
for key := range collectorsToStart {
121121
if collector, ok := initiatedCollectors[key]; ok {
122122
collectors[key] = collector
123123
} else {

0 commit comments

Comments
 (0)