@@ -309,7 +309,6 @@ func metricHelp(prefix, name string) string {
309309// GetAllIndexesForCollections returns all index names for the given list of "db.collection" strings.
310310func GetAllIndexesForCollections (ctx context.Context , client * mongo.Client , collections []string ) ([]string , error ) {
311311 var indexNames []string
312-
313312 for _ , dbCollection := range collections {
314313 parts := strings .SplitN (dbCollection , "." , 2 ) //nolint:mnd
315314 if len (parts ) != 2 {
@@ -321,8 +320,7 @@ func GetAllIndexesForCollections(ctx context.Context, client *mongo.Client, coll
321320 coll := client .Database (dbName ).Collection (collName )
322321 cursor , err := coll .Indexes ().List (ctx )
323322 if err != nil {
324- // skip collections where indexes cannot be listed (e.g., views, system collections)
325- continue
323+ continue // skip collections where indexes cannot be listed (e.g., views, system collections)
326324 }
327325 defer cursor .Close (ctx ) //nolint:errcheck
328326
@@ -369,7 +367,6 @@ func makeMetrics(reservedNames []string, prefix string, m bson.M, labels map[str
369367 return res
370368}
371369
372- // Helper for switch block from makeMetrics
373370func handleMetricSwitch (reservedNames []string , prefix , nextPrefix , k string , val interface {}, l map [string ]string , compatibleMode bool ) []prometheus.Metric {
374371 var res []prometheus.Metric
375372 switch v := val .(type ) {
@@ -408,6 +405,7 @@ func handleMetricSwitch(reservedNames []string, prefix, nextPrefix, k string, va
408405 }
409406 }
410407 }
408+
411409 return res
412410}
413411
0 commit comments