golangci-lint(noctx): fix test files

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
pull/7591/head
Matthieu MOREL 2024-03-28 21:08:02 +00:00
parent f7c0244183
commit 173f704796
2 changed files with 3 additions and 2 deletions

View File

@ -359,7 +359,6 @@ issues:
- gosec
- gosimple
- nilerr
- noctx
- staticcheck
- stylecheck
- unconvert

View File

@ -907,7 +907,9 @@ func getVeleroCliTarball(cliTarballUrl string) (*os.File, error) {
lastInd := strings.LastIndex(cliTarballUrl, "/")
tarball := cliTarballUrl[lastInd+1:]
resp, err := http.Get(cliTarballUrl)
cli := &http.Client{}
req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, cliTarballUrl, nil)
resp, err := cli.Do(req)
if err != nil {
return nil, errors.WithMessagef(err, "failed to access Velero CLI tarball")
}