Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Replace fmt.Sprintf with strconv.FormatBool #24

Merged
merged 1 commit into from
Jul 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func register(results []gaugeResult) {
vulnerabilityGauge.Reset()
for _, r := range results {
for _, result := range r.results {
vulnerabilityGauge.WithLabelValues(r.organization, r.project, result.title, result.severity, boolStr(result.ignored), boolStr(result.upgradeable), boolStr(result.patchable)).Set(float64(result.count))
vulnerabilityGauge.WithLabelValues(r.organization, r.project, result.title, result.severity, strconv.FormatBool(result.ignored), strconv.FormatBool(result.upgradeable), strconv.FormatBool(result.patchable)).Set(float64(result.count))
}
}
}
Expand Down Expand Up @@ -270,10 +270,6 @@ func collect(client *client, organization org) ([]gaugeResult, error) {
return gaugeResults, nil
}

func boolStr(b bool) string {
return fmt.Sprintf("%t", b)
}

type aggregateResult struct {
title string
severity string
Expand Down