diff --git a/dovecot_exporter.go b/dovecot_exporter.go index 7f04c2a0192c5cdee193bc1123a8f5f643053c21..75469c2675991c166c30e059415e44bd73e09c7c 100644 --- a/dovecot_exporter.go +++ b/dovecot_exporter.go @@ -24,6 +24,7 @@ var ( dovecotScopes = [...]string{"user"} ) +// Converts the output of Dovecot's EXPORT command to metrics. func CollectFromReader(file io.Reader, ch chan<- prometheus.Metric) error { scanner := bufio.NewScanner(file) scanner.Split(bufio.ScanLines) @@ -35,14 +36,11 @@ func CollectFromReader(file io.Reader, ch chan<- prometheus.Metric) error { columnNames := strings.Fields(scanner.Text()) columns := []*prometheus.Desc{} for _, columnName := range columnNames[1:] { - columns = append( - columns, - prometheus.NewDesc( - prometheus.BuildFQName("dovecot", columnNames[0], columnName), - "Help text not provided by this exporter.", - []string{columnNames[0]}, - nil, - )) + columns = append(columns, prometheus.NewDesc( + prometheus.BuildFQName("dovecot", columnNames[0], columnName), + "Help text not provided by this exporter.", + []string{columnNames[0]}, + nil)) } // Read successive lines, containing the values.