Skip to content

Commit a81b973

Browse files
authored
refactor: Fix gocritic.paramTypeCombine lint issues (#3655)
1 parent ac631dc commit a81b973

File tree

22 files changed

+74
-73
lines changed

22 files changed

+74
-73
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ linters:
2929
enabled-checks:
3030
- commentedOutCode
3131
- commentFormatting
32+
- paramTypeCombine
3233
goheader:
3334
values:
3435
regexp:

example/codespaces/newreposecretwithxcrypto/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func getSecretValue(secretName string) (string, error) {
122122
//
123123
// Finally, the github.EncodedSecret is passed into the GitHub client.Codespaces.CreateOrUpdateRepoSecret method to
124124
// populate the secret in the GitHub repo.
125-
func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error {
125+
func addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {
126126
publicKey, _, err := client.Codespaces.GetRepoPublicKey(ctx, owner, repo)
127127
if err != nil {
128128
return err
@@ -140,7 +140,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep
140140
return nil
141141
}
142142

143-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
143+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
144144
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
145145
if err != nil {
146146
return nil, fmt.Errorf("unable to decode public key: %v", err)

example/codespaces/newusersecretwithxcrypto/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func addUserSecret(ctx context.Context, client *github.Client, secretName, secre
147147
return nil
148148
}
149149

150-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
150+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
151151
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
152152
if err != nil {
153153
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)

example/newreposecretwithlibsodium/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func getSecretValue(secretName string) (string, error) {
118118
//
119119
// Finally, the github.EncodedSecret is passed into the GitHub client.Actions.CreateOrUpdateRepoSecret method to
120120
// populate the secret in the GitHub repo.
121-
func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error {
121+
func addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {
122122
publicKey, _, err := client.Actions.GetRepoPublicKey(ctx, owner, repo)
123123
if err != nil {
124124
return err
@@ -136,7 +136,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep
136136
return nil
137137
}
138138

139-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
139+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
140140
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
141141
if err != nil {
142142
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)

example/newreposecretwithxcrypto/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func getSecretValue(secretName string) (string, error) {
122122
//
123123
// Finally, the github.EncodedSecret is passed into the GitHub client.Actions.CreateOrUpdateRepoSecret method to
124124
// populate the secret in the GitHub repo.
125-
func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error {
125+
func addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {
126126
publicKey, _, err := client.Actions.GetRepoPublicKey(ctx, owner, repo)
127127
if err != nil {
128128
return err
@@ -140,7 +140,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep
140140
return nil
141141
}
142142

143-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
143+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
144144
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
145145
if err != nil {
146146
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)

github/actions_workflow_runs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo
259259
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs
260260
//
261261
//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs
262-
func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) {
262+
func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error) {
263263
u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber)
264264

265265
if s.client.RateLimitRedirectionalEndpoints {

github/git_blobs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Blob struct {
2626
// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob
2727
//
2828
//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha}
29-
func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) {
29+
func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blob, *Response, error) {
3030
u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha)
3131
req, err := s.client.NewRequest("GET", u, nil)
3232
if err != nil {
@@ -71,7 +71,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([
7171
// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob
7272
//
7373
//meta:operation POST /repos/{owner}/{repo}/git/blobs
74-
func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) {
74+
func (s *GitService) CreateBlob(ctx context.Context, owner, repo string, blob *Blob) (*Blob, *Response, error) {
7575
u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo)
7676
req, err := s.client.NewRequest("POST", u, blob)
7777
if err != nil {

github/git_commits.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (c CommitAuthor) String() string {
8484
// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object
8585
//
8686
//meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha}
87-
func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) {
87+
func (s *GitService) GetCommit(ctx context.Context, owner, repo, sha string) (*Commit, *Response, error) {
8888
u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha)
8989
req, err := s.client.NewRequest("GET", u, nil)
9090
if err != nil {
@@ -126,7 +126,7 @@ type CreateCommitOptions struct {
126126
// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit
127127
//
128128
//meta:operation POST /repos/{owner}/{repo}/git/commits
129-
func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) {
129+
func (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) {
130130
if commit == nil {
131131
return nil, nil, errors.New("commit must be provided")
132132
}

github/git_refs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type updateRefRequest struct {
5555
// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference
5656
//
5757
//meta:operation GET /repos/{owner}/{repo}/git/ref/{ref}
58-
func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) {
58+
func (s *GitService) GetRef(ctx context.Context, owner, repo, ref string) (*Reference, *Response, error) {
5959
ref = strings.TrimPrefix(ref, "refs/")
6060
u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref))
6161
req, err := s.client.NewRequest("GET", u, nil)
@@ -127,7 +127,7 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o
127127
// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference
128128
//
129129
//meta:operation POST /repos/{owner}/{repo}/git/refs
130-
func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) {
130+
func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref *Reference) (*Reference, *Response, error) {
131131
if ref == nil {
132132
return nil, nil, errors.New("reference must be provided")
133133
}
@@ -159,7 +159,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r
159159
// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference
160160
//
161161
//meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref}
162-
func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) {
162+
func (s *GitService) UpdateRef(ctx context.Context, owner, repo string, ref *Reference, force bool) (*Reference, *Response, error) {
163163
if ref == nil {
164164
return nil, nil, errors.New("reference must be provided")
165165
}
@@ -191,7 +191,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r
191191
// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference
192192
//
193193
//meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref}
194-
func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) {
194+
func (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) {
195195
ref = strings.TrimPrefix(ref, "refs/")
196196
u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref))
197197
req, err := s.client.NewRequest("DELETE", u, nil)

github/git_tags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type createTagRequest struct {
3939
// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag
4040
//
4141
//meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha}
42-
func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) {
42+
func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, *Response, error) {
4343
u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha)
4444
req, err := s.client.NewRequest("GET", u, nil)
4545
if err != nil {
@@ -60,7 +60,7 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha
6060
// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object
6161
//
6262
//meta:operation POST /repos/{owner}/{repo}/git/tags
63-
func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) {
63+
func (s *GitService) CreateTag(ctx context.Context, owner, repo string, tag *Tag) (*Tag, *Response, error) {
6464
if tag == nil {
6565
return nil, nil, errors.New("tag must be provided")
6666
}

0 commit comments

Comments
 (0)