mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-27 07:06:35 +00:00
Check for nil strings and include wrappers around each.
Signed-off-by: matt durham <mattdurham@ppog.org>
This commit is contained in:
@@ -30,6 +30,7 @@ import (
|
||||
"github.com/go-kit/log"
|
||||
"github.com/go-kit/log/level"
|
||||
"github.com/prometheus-community/windows_exporter/pkg/types"
|
||||
"github.com/prometheus-community/windows_exporter/pkg/utils"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
"github.com/prometheus/common/expfmt"
|
||||
@@ -103,7 +104,7 @@ func (c *collector) GetPerfCounter() ([]string, error) {
|
||||
|
||||
func (c *collector) Build() error {
|
||||
c.directories = ""
|
||||
if *c.textFileDirectory != "" || *c.textFileDirectories != "" {
|
||||
if utils.HasValue(c.textFileDirectory) || utils.HasValue(c.textFileDirectories) {
|
||||
c.directories = *c.textFileDirectory + "," + *c.textFileDirectories
|
||||
c.directories = strings.Trim(c.directories, ",")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user