use format string when using printf like commands

As per https://github.com/golang/go/issues/60529, printf like commands with
non-constant format strings and no args give an error in govet

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
Akhil Mohan
2024-08-14 16:01:12 +05:30
parent 1027b314a6
commit ebc47359ea
4 changed files with 9 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ import (
"compress/gzip"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"math/rand"
@@ -290,14 +291,14 @@ func TestDockerFetcherOpen(t *testing.T) {
{
name: "should return just status if the registry request fails and does not return a docker error",
mockedStatus: 500,
mockedErr: fmt.Errorf("Non-docker error"),
mockedErr: errors.New("Non-docker error"),
want: nil,
wantErr: true,
wantPlainError: true,
}, {
name: "should return StatusRequestTimeout after 5 retries",
mockedStatus: http.StatusRequestTimeout,
mockedErr: fmt.Errorf(http.StatusText(http.StatusRequestTimeout)),
mockedErr: errors.New(http.StatusText(http.StatusRequestTimeout)),
want: nil,
wantErr: true,
wantPlainError: true,
@@ -305,7 +306,7 @@ func TestDockerFetcherOpen(t *testing.T) {
}, {
name: "should return StatusTooManyRequests after 5 retries",
mockedStatus: http.StatusTooManyRequests,
mockedErr: fmt.Errorf(http.StatusText(http.StatusTooManyRequests)),
mockedErr: errors.New(http.StatusText(http.StatusTooManyRequests)),
want: nil,
wantErr: true,
wantPlainError: true,