Skip to content

Commit 9493278

Browse files
authored
refactor: fix revive.unused-parameter lint issues (#3603)
1 parent 49704bf commit 9493278

File tree

79 files changed

+188
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+188
-187
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ linters:
9898
- name: unexported-naming
9999
- name: unexported-return
100100
- name: unreachable-code
101+
- name: unused-parameter
101102
- name: use-any
102103
- name: var-declaration
103104
- name: var-naming

github/actions_artifacts_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func TestActionsService_DownloadArtifact(t *testing.T) {
320320
})
321321

322322
// Add custom round tripper
323-
client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) {
323+
client.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) {
324324
return nil, errors.New("failed to download artifact")
325325
})
326326
// propagate custom round tripper to client without CheckRedirect
@@ -529,7 +529,7 @@ func TestActionsService_DeleteArtifact(t *testing.T) {
529529
t.Parallel()
530530
client, mux, _ := setup(t)
531531

532-
mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) {
532+
mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(_ http.ResponseWriter, r *http.Request) {
533533
testMethod(t, r, "DELETE")
534534
})
535535

github/actions_cache_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TestActionsService_DeleteCachesByKey(t *testing.T) {
100100
t.Parallel()
101101
client, mux, _ := setup(t)
102102

103-
mux.HandleFunc("/repos/o/r/actions/caches", func(w http.ResponseWriter, r *http.Request) {
103+
mux.HandleFunc("/repos/o/r/actions/caches", func(_ http.ResponseWriter, r *http.Request) {
104104
testMethod(t, r, "DELETE")
105105
testFormValues(t, r, values{"key": "1", "ref": "main"})
106106
})
@@ -162,7 +162,7 @@ func TestActionsService_DeleteCachesByID(t *testing.T) {
162162
t.Parallel()
163163
client, mux, _ := setup(t)
164164

165-
mux.HandleFunc("/repos/o/r/actions/caches/1", func(w http.ResponseWriter, r *http.Request) {
165+
mux.HandleFunc("/repos/o/r/actions/caches/1", func(_ http.ResponseWriter, r *http.Request) {
166166
testMethod(t, r, "DELETE")
167167
})
168168

github/actions_runner_groups_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) {
153153
t.Parallel()
154154
client, mux, _ := setup(t)
155155

156-
mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(w http.ResponseWriter, r *http.Request) {
156+
mux.HandleFunc("/orgs/o/actions/runner-groups/2", func(_ http.ResponseWriter, r *http.Request) {
157157
testMethod(t, r, "DELETE")
158158
})
159159

@@ -328,7 +328,7 @@ func TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) {
328328
t.Parallel()
329329
client, mux, _ := setup(t)
330330

331-
mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(w http.ResponseWriter, r *http.Request) {
331+
mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories", func(_ http.ResponseWriter, r *http.Request) {
332332
testMethod(t, r, "PUT")
333333
})
334334

@@ -360,7 +360,7 @@ func TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) {
360360
t.Parallel()
361361
client, mux, _ := setup(t)
362362

363-
mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) {
363+
mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(_ http.ResponseWriter, r *http.Request) {
364364
testMethod(t, r, "PUT")
365365
})
366366

@@ -385,7 +385,7 @@ func TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) {
385385
t.Parallel()
386386
client, mux, _ := setup(t)
387387

388-
mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(w http.ResponseWriter, r *http.Request) {
388+
mux.HandleFunc("/orgs/o/actions/runner-groups/2/repositories/42", func(_ http.ResponseWriter, r *http.Request) {
389389
testMethod(t, r, "DELETE")
390390
})
391391

@@ -453,7 +453,7 @@ func TestActionsService_SetRunnerGroupRunners(t *testing.T) {
453453
t.Parallel()
454454
client, mux, _ := setup(t)
455455

456-
mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(w http.ResponseWriter, r *http.Request) {
456+
mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners", func(_ http.ResponseWriter, r *http.Request) {
457457
testMethod(t, r, "PUT")
458458
})
459459

@@ -485,7 +485,7 @@ func TestActionsService_AddRunnerGroupRunners(t *testing.T) {
485485
t.Parallel()
486486
client, mux, _ := setup(t)
487487

488-
mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) {
488+
mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(_ http.ResponseWriter, r *http.Request) {
489489
testMethod(t, r, "PUT")
490490
})
491491

@@ -510,7 +510,7 @@ func TestActionsService_RemoveRunnerGroupRunners(t *testing.T) {
510510
t.Parallel()
511511
client, mux, _ := setup(t)
512512

513-
mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(w http.ResponseWriter, r *http.Request) {
513+
mux.HandleFunc("/orgs/o/actions/runner-groups/2/runners/42", func(_ http.ResponseWriter, r *http.Request) {
514514
testMethod(t, r, "DELETE")
515515
})
516516

github/actions_runners_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func TestActionsService_RemoveRunner(t *testing.T) {
306306
t.Parallel()
307307
client, mux, _ := setup(t)
308308

309-
mux.HandleFunc("/repos/o/r/actions/runners/21", func(w http.ResponseWriter, r *http.Request) {
309+
mux.HandleFunc("/repos/o/r/actions/runners/21", func(_ http.ResponseWriter, r *http.Request) {
310310
testMethod(t, r, "DELETE")
311311
})
312312

@@ -529,7 +529,7 @@ func TestActionsService_RemoveOrganizationRunner(t *testing.T) {
529529
t.Parallel()
530530
client, mux, _ := setup(t)
531531

532-
mux.HandleFunc("/orgs/o/actions/runners/21", func(w http.ResponseWriter, r *http.Request) {
532+
mux.HandleFunc("/orgs/o/actions/runners/21", func(_ http.ResponseWriter, r *http.Request) {
533533
testMethod(t, r, "DELETE")
534534
})
535535

github/actions_secrets_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func TestActionsService_DeleteRepoSecret(t *testing.T) {
325325
t.Parallel()
326326
client, mux, _ := setup(t)
327327

328-
mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) {
328+
mux.HandleFunc("/repos/o/r/actions/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) {
329329
testMethod(t, r, "DELETE")
330330
})
331331

@@ -546,7 +546,7 @@ func TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) {
546546
t.Parallel()
547547
client, mux, _ := setup(t)
548548

549-
mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(w http.ResponseWriter, r *http.Request) {
549+
mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) {
550550
testMethod(t, r, "PUT")
551551
testHeader(t, r, "Content-Type", "application/json")
552552
testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n")
@@ -573,7 +573,7 @@ func TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) {
573573
t.Parallel()
574574
client, mux, _ := setup(t)
575575

576-
mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) {
576+
mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) {
577577
testMethod(t, r, "PUT")
578578
})
579579

@@ -599,7 +599,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) {
599599
t.Parallel()
600600
client, mux, _ := setup(t)
601601

602-
mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) {
602+
mux.HandleFunc("/orgs/o/actions/secrets/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) {
603603
testMethod(t, r, "DELETE")
604604
})
605605

@@ -625,7 +625,7 @@ func TestActionsService_DeleteOrgSecret(t *testing.T) {
625625
t.Parallel()
626626
client, mux, _ := setup(t)
627627

628-
mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(w http.ResponseWriter, r *http.Request) {
628+
mux.HandleFunc("/orgs/o/actions/secrets/NAME", func(_ http.ResponseWriter, r *http.Request) {
629629
testMethod(t, r, "DELETE")
630630
})
631631

@@ -835,7 +835,7 @@ func TestActionsService_DeleteEnvSecret(t *testing.T) {
835835
t.Parallel()
836836
client, mux, _ := setup(t)
837837

838-
mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(w http.ResponseWriter, r *http.Request) {
838+
mux.HandleFunc("/repositories/1/environments/e/secrets/secret", func(_ http.ResponseWriter, r *http.Request) {
839839
testMethod(t, r, "DELETE")
840840
})
841841

github/actions_variables_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func TestActionsService_DeleteRepoVariable(t *testing.T) {
209209
t.Parallel()
210210
client, mux, _ := setup(t)
211211

212-
mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) {
212+
mux.HandleFunc("/repos/o/r/actions/variables/NAME", func(_ http.ResponseWriter, r *http.Request) {
213213
testMethod(t, r, "DELETE")
214214
})
215215

@@ -429,7 +429,7 @@ func TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) {
429429
t.Parallel()
430430
client, mux, _ := setup(t)
431431

432-
mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(w http.ResponseWriter, r *http.Request) {
432+
mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories", func(_ http.ResponseWriter, r *http.Request) {
433433
testMethod(t, r, "PUT")
434434
testHeader(t, r, "Content-Type", "application/json")
435435
testBody(t, r, `{"selected_repository_ids":[64780797]}`+"\n")
@@ -456,7 +456,7 @@ func TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) {
456456
t.Parallel()
457457
client, mux, _ := setup(t)
458458

459-
mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) {
459+
mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) {
460460
testMethod(t, r, "PUT")
461461
})
462462

@@ -482,7 +482,7 @@ func TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) {
482482
t.Parallel()
483483
client, mux, _ := setup(t)
484484

485-
mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(w http.ResponseWriter, r *http.Request) {
485+
mux.HandleFunc("/orgs/o/actions/variables/NAME/repositories/1234", func(_ http.ResponseWriter, r *http.Request) {
486486
testMethod(t, r, "DELETE")
487487
})
488488

@@ -508,7 +508,7 @@ func TestActionsService_DeleteOrgVariable(t *testing.T) {
508508
t.Parallel()
509509
client, mux, _ := setup(t)
510510

511-
mux.HandleFunc("/orgs/o/actions/variables/NAME", func(w http.ResponseWriter, r *http.Request) {
511+
mux.HandleFunc("/orgs/o/actions/variables/NAME", func(_ http.ResponseWriter, r *http.Request) {
512512
testMethod(t, r, "DELETE")
513513
})
514514

@@ -680,7 +680,7 @@ func TestActionsService_DeleteEnvVariable(t *testing.T) {
680680
t.Parallel()
681681
client, mux, _ := setup(t)
682682

683-
mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(w http.ResponseWriter, r *http.Request) {
683+
mux.HandleFunc("/repos/usr/1/environments/e/variables/variable", func(_ http.ResponseWriter, r *http.Request) {
684684
testMethod(t, r, "DELETE")
685685
})
686686

github/actions_workflow_jobs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) {
230230
})
231231

232232
// Add custom round tripper
233-
client.client.Transport = roundTripperFunc(func(r *http.Request) (*http.Response, error) {
233+
client.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) {
234234
return nil, errors.New("failed to get workflow logs")
235235
})
236236
// propagate custom round tripper to client without CheckRedirect

github/actions_workflows_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) {
241241
"key": "value",
242242
},
243243
}
244-
mux.HandleFunc("/repos/o/r/actions/workflows/72844/dispatches", func(w http.ResponseWriter, r *http.Request) {
244+
mux.HandleFunc("/repos/o/r/actions/workflows/72844/dispatches", func(_ http.ResponseWriter, r *http.Request) {
245245
var v CreateWorkflowDispatchEventRequest
246246
assertNilError(t, json.NewDecoder(r.Body).Decode(&v))
247247

@@ -285,7 +285,7 @@ func TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) {
285285
"key": "value",
286286
},
287287
}
288-
mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/dispatches", func(w http.ResponseWriter, r *http.Request) {
288+
mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/dispatches", func(_ http.ResponseWriter, r *http.Request) {
289289
var v CreateWorkflowDispatchEventRequest
290290
assertNilError(t, json.NewDecoder(r.Body).Decode(&v))
291291

@@ -323,7 +323,7 @@ func TestActionsService_EnableWorkflowByID(t *testing.T) {
323323
t.Parallel()
324324
client, mux, _ := setup(t)
325325

326-
mux.HandleFunc("/repos/o/r/actions/workflows/72844/enable", func(w http.ResponseWriter, r *http.Request) {
326+
mux.HandleFunc("/repos/o/r/actions/workflows/72844/enable", func(_ http.ResponseWriter, r *http.Request) {
327327
testMethod(t, r, "PUT")
328328
if r.Body != http.NoBody {
329329
t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody)
@@ -358,7 +358,7 @@ func TestActionsService_EnableWorkflowByFilename(t *testing.T) {
358358
t.Parallel()
359359
client, mux, _ := setup(t)
360360

361-
mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/enable", func(w http.ResponseWriter, r *http.Request) {
361+
mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/enable", func(_ http.ResponseWriter, r *http.Request) {
362362
testMethod(t, r, "PUT")
363363
if r.Body != http.NoBody {
364364
t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody)
@@ -393,7 +393,7 @@ func TestActionsService_DisableWorkflowByID(t *testing.T) {
393393
t.Parallel()
394394
client, mux, _ := setup(t)
395395

396-
mux.HandleFunc("/repos/o/r/actions/workflows/72844/disable", func(w http.ResponseWriter, r *http.Request) {
396+
mux.HandleFunc("/repos/o/r/actions/workflows/72844/disable", func(_ http.ResponseWriter, r *http.Request) {
397397
testMethod(t, r, "PUT")
398398
if r.Body != http.NoBody {
399399
t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody)
@@ -428,7 +428,7 @@ func TestActionsService_DisableWorkflowByFileName(t *testing.T) {
428428
t.Parallel()
429429
client, mux, _ := setup(t)
430430

431-
mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/disable", func(w http.ResponseWriter, r *http.Request) {
431+
mux.HandleFunc("/repos/o/r/actions/workflows/main.yml/disable", func(_ http.ResponseWriter, r *http.Request) {
432432
testMethod(t, r, "PUT")
433433
if r.Body != http.NoBody {
434434
t.Errorf("Request body = %+v, want %+v", r.Body, http.NoBody)

github/activity_star_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func TestActivityService_Star(t *testing.T) {
222222
t.Parallel()
223223
client, mux, _ := setup(t)
224224

225-
mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) {
225+
mux.HandleFunc("/user/starred/o/r", func(_ http.ResponseWriter, r *http.Request) {
226226
testMethod(t, r, "PUT")
227227
})
228228

@@ -256,7 +256,7 @@ func TestActivityService_Unstar(t *testing.T) {
256256
t.Parallel()
257257
client, mux, _ := setup(t)
258258

259-
mux.HandleFunc("/user/starred/o/r", func(w http.ResponseWriter, r *http.Request) {
259+
mux.HandleFunc("/user/starred/o/r", func(_ http.ResponseWriter, r *http.Request) {
260260
testMethod(t, r, "DELETE")
261261
})
262262

0 commit comments

Comments
 (0)