From 9a5af4875f9190d48b704b20764ed4598f2b1dec Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Thu, 14 Nov 2024 13:52:09 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Alex Demidoff --- exporter/diagnostic_data_collector.go | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/diagnostic_data_collector.go b/exporter/diagnostic_data_collector.go index 409a76fa..e4b19fe0 100644 --- a/exporter/diagnostic_data_collector.go +++ b/exporter/diagnostic_data_collector.go @@ -117,7 +117,7 @@ func (d *diagnosticDataCollector) collect(ch chan<- prometheus.Metric) { debugResult(logger, m) // MongoDB 8.0 splits the diagnostic data into multiple blocks, so we need to merge them - if _, ok := m["common"]; ok { //nolint:gomnd,mng + if _, ok := m["common"]; ok { b := bson.M{} for _, mv := range m { block, ok := mv.(bson.M) diff --git a/main.go b/main.go index 1ed81690..a894588d 100644 --- a/main.go +++ b/main.go @@ -270,7 +270,7 @@ func parseURIList(uriList []string, logger *logrus.Logger, splitCluster bool) [] // buildURIManually builds the URI manually by checking if the user and password are supplied func buildURIManually(uri string, user string, password string) string { - uriArray := strings.SplitN(uri, "://", 2) + uriArray := strings.SplitN(uri, "://", 2) //nolint:mnd prefix := uriArray[0] + "://" uri = uriArray[1]