diff --git a/.golangci.yml b/.golangci.yml index 2f205e5..f9f0f03 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -81,6 +81,7 @@ linters: - nakedret - noctx - nolintlint + - perfsprint - revive - rowserrcheck - staticcheck diff --git a/collector/collector.go b/collector/collector.go index f43ca26..0554207 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -17,6 +17,7 @@ package collector import ( "fmt" + "strconv" "sync" "time" @@ -71,9 +72,9 @@ func registerCollector(collector string, isDefaultEnabled bool, factory func(log helpDefaultState = "disabled" } - flagName := fmt.Sprintf("collector.%s", collector) + flagName := "collector." + collector flagHelp := fmt.Sprintf("Enable the %s collector (default: %s).", collector, helpDefaultState) - defaultValue := fmt.Sprintf("%v", isDefaultEnabled) + defaultValue := strconv.FormatBool(isDefaultEnabled) flag := kingpin.Flag(flagName, flagHelp).Default(defaultValue).Action(collectorFlagAction(collector)).Bool() collectorState[collector] = flag