Skip to content

Commit fc17640

Browse files
committed
Appease gometalinter, don't shadow namespace
1 parent 84b6691 commit fc17640

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/postgres_exporter/postgres_exporter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ func makeDescMap(pgVersion semver.Version, serverLabels prometheus.Labels, metri
601601
for namespace, intermediateMappings := range metricMaps {
602602
thisMap := make(map[string]MetricMap)
603603

604+
namespace = strings.Replace(namespace, "pg", *metricPrefix, 1)
605+
604606
// Get the constant labels
605607
var variableLabels []string
606608
for columnName, columnMapping := range intermediateMappings.columnMappings {
@@ -627,8 +629,6 @@ func makeDescMap(pgVersion semver.Version, serverLabels prometheus.Labels, metri
627629
}
628630
}
629631

630-
namespace := strings.Replace(namespace, "pg", *metricPrefix, 1)
631-
632632
// Determine how to convert the column based on its usage.
633633
// nolint: dupl
634634
switch columnMapping.usage {

0 commit comments

Comments
 (0)