Skip to content

Commit 3477e87

Browse files
committed
satisfy linter
1 parent 72a751b commit 3477e87

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

exporter/diagnostic_data_collector_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func newErrorCountHandler(opts *slog.HandlerOptions) *errorCountHandler {
274274
return h
275275
}
276276

277-
func (h *errorCountHandler) Handle(ctx context.Context, r slog.Record) error {
277+
func (h *errorCountHandler) Handle(_ context.Context, r slog.Record) error {
278278
if r.Level == slog.LevelError || r.Level == slog.LevelWarn {
279279
h.logRecords = append(h.logRecords, r)
280280
}
@@ -285,11 +285,11 @@ func (h *errorCountHandler) Enabled(_ context.Context, level slog.Level) bool {
285285
return level >= slog.LevelInfo
286286
}
287287

288-
func (h *errorCountHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
288+
func (h *errorCountHandler) WithAttrs(_ []slog.Attr) slog.Handler {
289289
return h
290290
}
291291

292-
func (h *errorCountHandler) WithGroup(name string) slog.Handler {
292+
func (h *errorCountHandler) WithGroup(_ string) slog.Handler {
293293
return h
294294
}
295295

exporter/server.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ func OverallTargetsHandler(exporters []*Exporter, logger *slog.Logger) http.Hand
138138
if !e.opts.GlobalConnPool {
139139
defer func() {
140140
if client != nil {
141-
err := client.Disconnect(ctx)
142-
if err != nil {
141+
if err := client.Disconnect(ctx); err != nil {
143142
logger.Error("Cannot disconnect client", "error", err)
144143
}
145144
}

exporter/v1_compatibility.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ func oplogStatus(ctx context.Context, client *mongo.Client) ([]prometheus.Metric
984984
return []prometheus.Metric{headMetric, tailMetric}, nil
985985
}
986986

987-
func replSetMetrics(d bson.M, l *slog.Logger) []prometheus.Metric { //nolint:cyclop
987+
func replSetMetrics(d bson.M, l *slog.Logger) []prometheus.Metric { //nolint:cyclop,funlen
988988
var repl proto.ReplicaSetStatus
989989
b, err := bson.Marshal(d)
990990
if err != nil {

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func buildServers(opts GlobalFlags, logger *slog.Logger) []*exporter.Exporter {
210210
return servers
211211
}
212212

213-
func parseURIList(uriList []string, logger *slog.Logger, splitCluster bool) []string { //nolint:gocognit
213+
func parseURIList(uriList []string, logger *slog.Logger, splitCluster bool) []string { //nolint:gocognit,cyclop
214214
var URIs []string
215215

216216
// If server URI is prefixed with mongodb scheme string, then every next URI in

0 commit comments

Comments
 (0)