chore: Cleanup printer.go (#12164)

This commit is contained in:
Sebastian Spaink 2022-11-03 13:11:25 -05:00 committed by GitHub
parent 497297a92a
commit e1cc22deca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 24 deletions

View File

@ -136,7 +136,6 @@ func printSampleConfig(
pnames = append(pnames, pname)
}
}
sort.Strings(pnames)
printFilteredOutputs(pnames, true, outputBuffer)
}
}
@ -154,7 +153,6 @@ func printSampleConfig(
for pname := range processors.Processors {
pnames = append(pnames, pname)
}
sort.Strings(pnames)
printFilteredProcessors(pnames, true, outputBuffer)
}
}
@ -172,7 +170,6 @@ func printSampleConfig(
for pname := range aggregators.Aggregators {
pnames = append(pnames, pname)
}
sort.Strings(pnames)
printFilteredAggregators(pnames, true, outputBuffer)
}
}
@ -194,32 +191,11 @@ func printSampleConfig(
pnames = append(pnames, pname)
}
}
sort.Strings(pnames)
printFilteredInputs(pnames, true, outputBuffer)
}
}
}
// PluginNameCounts returns a list of sorted plugin names and their count
func PluginNameCounts(plugins []string) []string {
names := make(map[string]int)
for _, plugin := range plugins {
names[plugin]++
}
var namecount []string
for name, count := range names {
if count == 1 {
namecount = append(namecount, name)
} else {
namecount = append(namecount, fmt.Sprintf("%s (%dx)", name, count))
}
}
sort.Strings(namecount)
return namecount
}
func printFilteredProcessors(processorFilters []string, commented bool, outputBuffer io.Writer) {
// Filter processors
var pnames []string