From 6efa9af960151db1d06c86aa04ac35aa6ca36670 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Wed, 12 Jul 2023 13:59:23 +0800 Subject: [PATCH] chore: unnecessary use of fmt.Sprintf --- cloudwatch/cloudwatch.go | 2 +- cloudwatch/cloudwatch_test.go | 2 +- cmd/bosun/database/sentinel/sentinel.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudwatch/cloudwatch.go b/cloudwatch/cloudwatch.go index 05604b2460..17a3932c2e 100644 --- a/cloudwatch/cloudwatch.go +++ b/cloudwatch/cloudwatch.go @@ -269,7 +269,7 @@ func (c *cloudWatchContext) Query(r *Request) (Response, error) { } // custom metrics can have no dimensions if len(r.Dimensions) == 0 { - id = fmt.Sprintf("q0") + id = "q0" dq := buildQuery(r, id, nil) dqs = append(dqs, &dq) tagSet[id] = buildTags(nil) diff --git a/cloudwatch/cloudwatch_test.go b/cloudwatch/cloudwatch_test.go index 0c8be1d225..6bb80e4c5e 100644 --- a/cloudwatch/cloudwatch_test.go +++ b/cloudwatch/cloudwatch_test.go @@ -149,7 +149,7 @@ func (c mockCloudWatchClient) GetMetricData(input *cloudwatch.GetMetricDataInput } for i := 0; i < 10; i++ { - id := fmt.Sprintf("q{i}") + id := "q{i}" m := cloudwatch.MetricDataResult{ Id: &id, Label: nil, diff --git a/cmd/bosun/database/sentinel/sentinel.go b/cmd/bosun/database/sentinel/sentinel.go index 79209e9f0d..9a389352eb 100644 --- a/cmd/bosun/database/sentinel/sentinel.go +++ b/cmd/bosun/database/sentinel/sentinel.go @@ -92,7 +92,7 @@ func (ns NoSentinelsAvailable) Error() string { if ns.lastError != nil { return fmt.Sprintf("redigo: no sentinels available; last error: %s", ns.lastError.Error()) } - return fmt.Sprintf("redigo: no sentinels available") + return "redigo: no sentinels available" } // putToTop puts Sentinel address to the top of address list - this means