chore: fix unused parameter lint in new golangcilint version

This commit is contained in:
Malte Poll 2024-02-21 13:30:31 +01:00
parent 68fc2b0811
commit 65903459a0
35 changed files with 92 additions and 92 deletions

View file

@ -80,7 +80,7 @@ func TestInstall(t *testing.T) {
wantFiles: map[string][]byte{"/destination": []byte("file-contents")},
},
"download fails": {
server: newHTTPBufconnServer(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) }),
server: newHTTPBufconnServer(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(500) }),
component: &components.Component{
Url: serverURL,
Hash: "sha256:abc",
@ -89,7 +89,7 @@ func TestInstall(t *testing.T) {
wantErr: true,
},
"dataurl works": {
server: newHTTPBufconnServer(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) }),
server: newHTTPBufconnServer(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(500) }),
component: &components.Component{
Url: "data:text/plain,file-contents",
Hash: "",
@ -98,7 +98,7 @@ func TestInstall(t *testing.T) {
wantFiles: map[string][]byte{"/destination": []byte("file-contents")},
},
"broken dataurl fails": {
server: newHTTPBufconnServer(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) }),
server: newHTTPBufconnServer(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(500) }),
component: &components.Component{
Url: "data:file-contents",
Hash: "",
@ -129,7 +129,7 @@ func TestInstall(t *testing.T) {
fs: &afero.Afero{Fs: afero.NewMemMapFs()},
hClient: &hClient,
clock: testclock.NewFakeClock(time.Time{}),
retriable: func(err error) bool { return false },
retriable: func(_ error) bool { return false },
}
err := inst.Install(context.Background(), tc.component)
@ -388,7 +388,7 @@ func TestDownloadToTempDir(t *testing.T) {
wantFile: []byte("file-contents"),
},
"download fails": {
server: newHTTPBufconnServer(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) }),
server: newHTTPBufconnServer(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(500) }),
wantErr: true,
},
"creating temp file fails on RO fs": {
@ -397,7 +397,7 @@ func TestDownloadToTempDir(t *testing.T) {
wantErr: true,
},
"content length mismatch": {
server: newHTTPBufconnServer(func(writer http.ResponseWriter, request *http.Request) {
server: newHTTPBufconnServer(func(writer http.ResponseWriter, _ *http.Request) {
writer.Header().Set("Content-Length", "1337")
writer.WriteHeader(200)
}),
@ -607,7 +607,7 @@ func newHTTPBufconnServer(handlerFunc http.HandlerFunc) httpBufconnServer {
}
func newHTTPBufconnServerWithBody(body []byte) httpBufconnServer {
return newHTTPBufconnServer(func(writer http.ResponseWriter, request *http.Request) {
return newHTTPBufconnServer(func(writer http.ResponseWriter, _ *http.Request) {
if _, err := writer.Write(body); err != nil {
panic(err)
}
@ -615,7 +615,7 @@ func newHTTPBufconnServerWithBody(body []byte) httpBufconnServer {
}
func newHTTPBufconnServerWithState(state chan int, body []byte) httpBufconnServer {
return newHTTPBufconnServer(func(w http.ResponseWriter, r *http.Request) {
return newHTTPBufconnServer(func(w http.ResponseWriter, _ *http.Request) {
switch <-state {
case 500:
w.WriteHeader(500)