@@ -109,13 +109,13 @@ type fghc struct {
109
109
collaborators []string
110
110
}
111
111
112
- func (f * fghc ) GetSingleCommit (org , repo , sha string ) (github.RepositoryCommit , error ) {
112
+ func (f * fghc ) GetSingleCommit (_ , _ , sha string ) (github.RepositoryCommit , error ) {
113
113
f .Lock ()
114
114
defer f .Unlock ()
115
115
return f .commits [sha ], nil
116
116
}
117
117
118
- func (f * fghc ) AddLabels (org , repo string , number int , labels ... string ) error {
118
+ func (f * fghc ) AddLabels (_ , _ string , number int , labels ... string ) error {
119
119
f .Lock ()
120
120
defer f .Unlock ()
121
121
for i := range f .prs {
@@ -128,7 +128,7 @@ func (f *fghc) AddLabels(org, repo string, number int, labels ...string) error {
128
128
return nil
129
129
}
130
130
131
- func (f * fghc ) AssignIssue (org , repo string , number int , logins []string ) error {
131
+ func (f * fghc ) AssignIssue (_ , _ string , number int , logins []string ) error {
132
132
f .Lock ()
133
133
defer f .Unlock ()
134
134
var users []github.User
@@ -143,19 +143,19 @@ func (f *fghc) AssignIssue(org, repo string, number int, logins []string) error
143
143
return nil
144
144
}
145
145
146
- func (f * fghc ) GetPullRequest (org , repo string , number int ) (* github.PullRequest , error ) {
146
+ func (f * fghc ) GetPullRequest (string , string , int ) (* github.PullRequest , error ) {
147
147
f .Lock ()
148
148
defer f .Unlock ()
149
149
return f .pr , nil
150
150
}
151
151
152
- func (f * fghc ) GetPullRequestPatch (org , repo string , number int ) ([]byte , error ) {
152
+ func (f * fghc ) GetPullRequestPatch (string , string , int ) ([]byte , error ) {
153
153
f .Lock ()
154
154
defer f .Unlock ()
155
155
return f .patch , nil
156
156
}
157
157
158
- func (f * fghc ) GetPullRequests (org , repo string ) ([]github.PullRequest , error ) {
158
+ func (f * fghc ) GetPullRequests (string , string ) ([]github.PullRequest , error ) {
159
159
f .Lock ()
160
160
defer f .Unlock ()
161
161
return f .prs , nil
@@ -172,13 +172,13 @@ func (f *fghc) CreateComment(org, repo string, number int, comment string) error
172
172
return nil
173
173
}
174
174
175
- func (f * fghc ) GetRepo (owner , name string ) (github.FullRepo , error ) {
175
+ func (f * fghc ) GetRepo (_ , _ string ) (github.FullRepo , error ) {
176
176
f .Lock ()
177
177
defer f .Unlock ()
178
178
return github.FullRepo {}, nil
179
179
}
180
180
181
- func (f * fghc ) EnsureFork (forkingUser , org , repo string ) (string , error ) {
181
+ func (f * fghc ) EnsureFork (_ , _ , repo string ) (string , error ) {
182
182
if repo == "changeme" {
183
183
return "changed" , nil
184
184
}
@@ -188,7 +188,7 @@ func (f *fghc) EnsureFork(forkingUser, org, repo string) (string, error) {
188
188
return repo , nil
189
189
}
190
190
191
- func (f * fghc ) IsMember (org , user string ) (bool , error ) {
191
+ func (f * fghc ) IsMember (_ , user string ) (bool , error ) {
192
192
f .Lock ()
193
193
defer f .Unlock ()
194
194
@@ -200,15 +200,15 @@ func (f *fghc) IsMember(org, user string) (bool, error) {
200
200
}
201
201
}
202
202
203
- func (f * fghc ) IsCollaborator (org , repo , user string ) (bool , error ) {
203
+ func (f * fghc ) IsCollaborator (_ , _ , user string ) (bool , error ) {
204
204
if strings .Contains (user , patternErrWhenIsCollaborator ) {
205
205
return false , errors .New ("fake error" )
206
206
}
207
207
208
208
return sets .NewString (f .collaborators ... ).Has (user ), nil
209
209
}
210
210
211
- func (f * fghc ) AddCollaborator (org , repo , user string , permission github.RepoPermissionLevel ) error {
211
+ func (f * fghc ) AddCollaborator (_ , _ , user string , _ github.RepoPermissionLevel ) error {
212
212
if strings .Contains (user , patternErrWhenAddCollaborator ) {
213
213
return errors .New ("fake error" )
214
214
}
@@ -217,7 +217,7 @@ func (f *fghc) AddCollaborator(org, repo, user string, permission github.RepoPer
217
217
return nil
218
218
}
219
219
220
- func (f * fghc ) ListRepoInvitations (org , repo string ) ([]* gc.RepositoryInvitation , error ) {
220
+ func (f * fghc ) ListRepoInvitations (string , string ) ([]* gc.RepositoryInvitation , error ) {
221
221
return f .repoInvitations , nil
222
222
}
223
223
@@ -234,7 +234,7 @@ func prToString(pr github.PullRequest) string {
234
234
return fmt .Sprintf (prFormat , pr .Title , pr .Body , pr .Head .Ref , pr .Base .Ref , labels , assignees )
235
235
}
236
236
237
- func (f * fghc ) CreateIssue (org , repo , title , body string , milestone int , labels , assignees []string ) (int , error ) {
237
+ func (f * fghc ) CreateIssue (_ , _ , title , body string , _ int , labels , assignees []string ) (int , error ) {
238
238
f .Lock ()
239
239
defer f .Unlock ()
240
240
@@ -262,7 +262,7 @@ func (f *fghc) CreateIssue(org, repo, title, body string, milestone int, labels,
262
262
return num , nil
263
263
}
264
264
265
- func (f * fghc ) CreatePullRequest (org , repo , title , body , head , base string , canModify bool ) (int , error ) {
265
+ func (f * fghc ) CreatePullRequest (_ , _ , title , body , head , base string , _ bool ) (int , error ) {
266
266
f .Lock ()
267
267
defer f .Unlock ()
268
268
num := len (f .prs ) + 1
@@ -276,19 +276,19 @@ func (f *fghc) CreatePullRequest(org, repo, title, body, head, base string, canM
276
276
return num , nil
277
277
}
278
278
279
- func (f * fghc ) ListIssueComments (org , repo string , number int ) ([]github.IssueComment , error ) {
279
+ func (f * fghc ) ListIssueComments (_ , _ string , _ int ) ([]github.IssueComment , error ) {
280
280
f .Lock ()
281
281
defer f .Unlock ()
282
282
return f .prComments , nil
283
283
}
284
284
285
- func (f * fghc ) GetIssueLabels (org , repo string , number int ) ([]github.Label , error ) {
285
+ func (f * fghc ) GetIssueLabels (_ , _ string , _ int ) ([]github.Label , error ) {
286
286
f .Lock ()
287
287
defer f .Unlock ()
288
288
return f .prLabels , nil
289
289
}
290
290
291
- func (f * fghc ) ListOrgMembers (org , role string ) ([]github.TeamMember , error ) {
291
+ func (f * fghc ) ListOrgMembers (_ , role string ) ([]github.TeamMember , error ) {
292
292
f .Lock ()
293
293
defer f .Unlock ()
294
294
if role != "all" {
@@ -297,7 +297,7 @@ func (f *fghc) ListOrgMembers(org, role string) ([]github.TeamMember, error) {
297
297
return f .orgMembers , nil
298
298
}
299
299
300
- func (f * fghc ) CreateFork (org , repo string ) (string , error ) {
300
+ func (f * fghc ) CreateFork (_ , repo string ) (string , error ) {
301
301
return repo , nil
302
302
}
303
303
@@ -418,7 +418,7 @@ func testCherryPickIC(clients localgit.Clients, t *testing.T) {
418
418
BotUser : botUser ,
419
419
GitClient : c ,
420
420
ConfigAgent : ca ,
421
- Push : func (forkName , newBranch string , force bool ) error { return nil },
421
+ Push : func (_ , _ string , _ bool ) error { return nil },
422
422
GitHubClient : ghc ,
423
423
WebhookSecretGenerator : getSecret ,
424
424
GitHubTokenGenerator : getGithubToken ,
@@ -600,7 +600,7 @@ func testCherryPickPRWithLabels(clients localgit.Clients, t *testing.T) {
600
600
BotUser : botUser ,
601
601
GitClient : c ,
602
602
ConfigAgent : ca ,
603
- Push : func (forkName , newBranch string , force bool ) error { return nil },
603
+ Push : func (_ , _ string , _ bool ) error { return nil },
604
604
GitHubClient : ghc ,
605
605
WebhookSecretGenerator : getSecret ,
606
606
GitHubTokenGenerator : getGithubToken ,
@@ -810,7 +810,7 @@ func testCherryPickPRWithComment(clients localgit.Clients, t *testing.T) {
810
810
BotUser : botUser ,
811
811
GitClient : c ,
812
812
ConfigAgent : ca ,
813
- Push : func (forkName , newBranch string , force bool ) error { return nil },
813
+ Push : func (_ , _ string , _ bool ) error { return nil },
814
814
GitHubClient : ghc ,
815
815
WebhookSecretGenerator : getSecret ,
816
816
GitHubTokenGenerator : getGithubToken ,
@@ -1037,7 +1037,7 @@ func testCherryPickPRLabeled(clients localgit.Clients, t *testing.T) {
1037
1037
BotUser : botUser ,
1038
1038
GitClient : c ,
1039
1039
ConfigAgent : ca ,
1040
- Push : func (forkName , newBranch string , force bool ) error { return nil },
1040
+ Push : func (_ , _ string , _ bool ) error { return nil },
1041
1041
GitHubClient : ghc ,
1042
1042
WebhookSecretGenerator : getSecret ,
1043
1043
GitHubTokenGenerator : getGithubToken ,
@@ -1363,7 +1363,7 @@ type threadUnsafeFGHC struct {
1363
1363
orgRepoCountCalled int
1364
1364
}
1365
1365
1366
- func (tuf * threadUnsafeFGHC ) EnsureFork (login , org , repo string ) (string , error ) {
1366
+ func (tuf * threadUnsafeFGHC ) EnsureFork (_ , _ , _ string ) (string , error ) {
1367
1367
tuf .orgRepoCountCalled ++
1368
1368
return "" , errors .New ("that is enough" )
1369
1369
}
0 commit comments