Skip to content

Commit

Permalink
chore: unnecessary use of fmt.Sprintf (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Jul 18, 2023
1 parent f9dea19 commit 2952a00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions probe/base/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,13 @@ func TestStatusThreshold2(t *testing.T) {
p.ProbeResult.Status = probe.StatusUp

p.ProbeFunc = func() (bool, string) {
return true, fmt.Sprintf("success")
return true, "success"
}
p.Probe()
assert.Equal(t, probe.StatusUp, p.Result().Status)

p.ProbeFunc = func() (bool, string) {
return false, fmt.Sprintf("failure")
return false, "failure"
}
p.Probe()
assert.Equal(t, probe.StatusUp, p.Result().Status)
Expand All @@ -234,7 +234,7 @@ func TestStatusThreshold2(t *testing.T) {
assert.Equal(t, probe.StatusDown, p.Result().Status)

p.ProbeFunc = func() (bool, string) {
return true, fmt.Sprintf("success")
return true, "success"
}
p.Probe()
assert.Equal(t, probe.StatusUp, p.Result().Status)
Expand Down
2 changes: 1 addition & 1 deletion probe/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (h *HTTP) DoProbe() (bool, string) {
}
if !result {
log.Errorf("[%s / %s] - expression is evaluated to false!", h.ProbeKind, h.ProbeName)
message += fmt.Sprintf(". Expression is evaluated to false!")
message += ". Expression is evaluated to false!"
for k, v := range h.Evaluator.ExtractedValues {
message += fmt.Sprintf(" [%s = %v]", k, v)
log.Debugf("[%s / %s] - Expression Value: [%s] = [%v]", h.ProbeKind, h.ProbeName, k, v)
Expand Down

0 comments on commit 2952a00

Please sign in to comment.