make it more safer

This commit is contained in:
ethanvc 2023-12-22 22:33:59 +08:00
parent 6f666c7bd2
commit 15e70e5e63
1 changed files with 1 additions and 1 deletions

View File

@ -92,7 +92,7 @@ func NormalizeMetricFamilies(metricFamiliesByName map[string]*dto.MetricFamily)
result = append(result, mf)
}
sort.Slice(result, func(i, j int) bool {
return *result[i].Name < *result[j].Name
return result[i].GetName() < result[j].GetName()
})
return result
}