Skip to content

Commit

Permalink
chore: Add perfsprint
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Trangoni <[email protected]>
  • Loading branch information
mjtrangoni committed May 15, 2024
1 parent 2f0db82 commit e08b22d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ linters:
- nakedret
- noctx
- nolintlint
- perfsprint
- revive
- rowserrcheck
- staticcheck
Expand Down
5 changes: 3 additions & 2 deletions collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package collector

import (
"fmt"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e08b22d

Please sign in to comment.