chore: enable more linter (#1557)

This commit is contained in:
Jan-Otto Kröpke
2024-08-10 22:05:33 +02:00
committed by GitHub
parent 27a3553dac
commit 9b02e4a0ea
87 changed files with 337 additions and 494 deletions

View File

@@ -60,7 +60,7 @@ type Collector struct {
requestSecs *prometheus.Desc
}
// All available collector functions
// All available collector functions.
var smbclientAllCollectorNames = []string{
"ClientShares",
}
@@ -224,9 +224,7 @@ func (c *Collector) Build() error {
}
if *c.smbClientCollectorsEnabled == "" {
for _, collectorName := range smbclientAllCollectorNames {
c.enabledCollectors = append(c.enabledCollectors, collectorName)
}
c.enabledCollectors = append(c.enabledCollectors, smbclientAllCollectorNames...)
} else {
for _, collectorName := range strings.Split(*c.smbClientCollectorsEnabled, ",") {
if slices.Contains(smbclientAllCollectorNames, collectorName) {
@@ -240,7 +238,7 @@ func (c *Collector) Build() error {
return nil
}
// Collect collects smb client metrics and sends them to prometheus
// Collect collects smb client metrics and sends them to prometheus.
func (c *Collector) Collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metric) error {
collectorFuncs := map[string]func(ctx *types.ScrapeContext, ch chan<- prometheus.Metric) error{
"ClientShares": c.collectClientShares,
@@ -255,7 +253,7 @@ func (c *Collector) Collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
return nil
}
// Perflib: SMB Client Shares
// Perflib: SMB Client Shares.
type perflibClientShares struct {
Name string