Skip to content

Commit c46b249

Browse files
Improve comments
Signed-off-by: Edwin Mackenzie-Owen <[email protected]>
1 parent f020f50 commit c46b249

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

stackdriver_exporter.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -356,21 +356,20 @@ func main() {
356356
}
357357

358358
func parseMetricTypePrefixes(inputPrefixes []string) (metricTypePrefixes []string) {
359-
// drop duplicate prefixes
359+
// Drop duplicate prefixes.
360360
slices.Sort(inputPrefixes)
361361
uniquePrefixes := slices.Compact(inputPrefixes)
362362

363-
// drop prefixes that start with another existing prefix to avoid error:
364-
// "collected metric xxx was collected before with the same name and label values"
363+
// Drop prefixes that start with another existing prefix to avoid error:
364+
// "collected metric xxx was collected before with the same name and label values".
365365
for i, prefix := range uniquePrefixes {
366366
if i == 0 {
367367
metricTypePrefixes = []string{prefix}
368368
} else {
369369
previousIndex := len(metricTypePrefixes) - 1
370370

371-
// current prefix starts with previous one
371+
// Drop current prefix if it starts with the previous one.
372372
if strings.HasPrefix(prefix, metricTypePrefixes[previousIndex]) {
373-
// drop current prefix
374373
continue
375374
}
376375

0 commit comments

Comments
 (0)