make go vet happy

Address `non-constant format string in call` check:
https://github.com/golang/go/issues/60529

Signed-off-by: hagen1778 <roman@victoriametrics.com>
(cherry picked from commit febba3971b)
This commit is contained in:
hagen1778 2024-08-19 21:15:33 +02:00
parent d4c334b705
commit bd6405df01
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640
3 changed files with 4 additions and 5 deletions

View file

@ -13,7 +13,7 @@ func BenchmarkMetrics(b *testing.B) {
var pi promInstant
if err := pi.Unmarshal(payload); err != nil {
b.Fatalf(err.Error())
b.Fatal(err.Error())
}
b.Run("Instant", func(b *testing.B) {
for i := 0; i < b.N; i++ {

View file

@ -194,7 +194,7 @@ func requestHandler(w http.ResponseWriter, r *http.Request) bool {
startTime := time.Now()
defer requestDuration.UpdateDuration(startTime)
tracerEnabled := httputils.GetBool(r, "trace")
qt := querytracer.New(tracerEnabled, r.URL.Path)
qt := querytracer.New(tracerEnabled, "%s", r.URL.Path)
// Limit the number of concurrent queries.
select {

View file

@ -1,7 +1,6 @@
package querytracer
import (
"fmt"
"regexp"
"sync"
"testing"
@ -153,11 +152,11 @@ func TestTraceConcurrent(t *testing.T) {
childLocal.Done()
var wg sync.WaitGroup
for i := 0; i < 3; i++ {
child := qt.NewChild(fmt.Sprintf("child %d", i))
child := qt.NewChild("child %d", i)
wg.Add(1)
go func() {
for j := 0; j < 100; j++ {
child.Printf(fmt.Sprintf("message %d", j))
child.Printf("message %d", j)
}
wg.Done()
}()