Skip to content

Commit 25d9502

Browse files
committed
Run go fix and remove unused funcs
Signed-off-by: Timo Sand <[email protected]>
1 parent 547f607 commit 25d9502

52 files changed

Lines changed: 300 additions & 308 deletions

File tree

Some content is hidden

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

github/data_source_github_branch_protection_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func dataSourceGithubBranchProtectionRulesRead(ctx context.Context, d *schema.Re
7474
if !query.Repository.BranchProtectionRules.PageInfo.HasNextPage {
7575
break
7676
}
77-
variables["cursor"] = githubv4.NewString(query.Repository.BranchProtectionRules.PageInfo.EndCursor)
77+
variables["cursor"] = new(query.Repository.BranchProtectionRules.PageInfo.EndCursor)
7878
}
7979

8080
d.SetId(string(query.Repository.ID))

github/data_source_github_organization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func dataSourceGithubOrganizationRead(ctx context.Context, d *schema.ResourceDat
241241
if !query.Organization.MembersWithRole.PageInfo.HasNextPage {
242242
break
243243
}
244-
variables["after"] = githubv4.NewString(query.Organization.MembersWithRole.PageInfo.EndCursor)
244+
variables["after"] = new(query.Organization.MembersWithRole.PageInfo.EndCursor)
245245
}
246246

247247
_ = d.Set("repositories", repoList)

github/data_source_github_organization_external_identities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func dataSourceGithubOrganizationExternalIdentitiesRead(ctx context.Context, d *
121121
if !query.Organization.SamlIdentityProvider.PageInfo.HasNextPage {
122122
break
123123
}
124-
variables["after"] = githubv4.NewString(query.Organization.SamlIdentityProvider.PageInfo.EndCursor)
124+
variables["after"] = new(query.Organization.SamlIdentityProvider.PageInfo.EndCursor)
125125
}
126126

127127
d.SetId(name)

github/data_source_github_organization_ip_allow_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func dataSourceGithubOrganizationIpAllowListRead(ctx context.Context, d *schema.
9898
if !query.Organization.IpAllowListEntries.PageInfo.HasNextPage {
9999
break
100100
}
101-
variables["entriesCursor"] = githubv4.NewString(query.Organization.IpAllowListEntries.PageInfo.EndCursor)
101+
variables["entriesCursor"] = new(query.Organization.IpAllowListEntries.PageInfo.EndCursor)
102102
}
103103
for index := range ipAllowListEntries {
104104
ipAllowList = append(ipAllowList, map[string]any{

github/data_source_github_organization_teams.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func dataSourceGithubOrganizationTeamsRead(ctx context.Context, d *schema.Resour
131131
if !query.Organization.Teams.PageInfo.HasNextPage {
132132
break
133133
}
134-
variables["cursor"] = githubv4.NewString(query.Organization.Teams.PageInfo.EndCursor)
134+
variables["cursor"] = new(query.Organization.Teams.PageInfo.EndCursor)
135135
}
136136

137137
d.SetId(string(query.Organization.ID))

github/resource_github_actions_organization_permissions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func resourceGithubActionsOrganizationPermissionsCreateOrUpdate(d *schema.Resour
159159
}
160160

161161
if v, ok := d.GetOk("sha_pinning_required"); ok {
162-
actionsPermissions.SHAPinningRequired = github.Ptr(v.(bool))
162+
actionsPermissions.SHAPinningRequired = new(v.(bool))
163163
}
164164

165165
_, _, err = client.Actions.UpdateActionsPermissions(ctx,
@@ -313,8 +313,8 @@ func resourceGithubActionsOrganizationPermissionsDelete(d *schema.ResourceData,
313313
_, _, err = client.Actions.UpdateActionsPermissions(ctx,
314314
orgName,
315315
github.ActionsPermissions{
316-
AllowedActions: github.Ptr("all"),
317-
EnabledRepositories: github.Ptr("all"),
316+
AllowedActions: new("all"),
317+
EnabledRepositories: new("all"),
318318
})
319319
if err != nil {
320320
return err

github/resource_github_actions_organization_secret_repository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func resourceGithubActionsOrganizationSecretRepositoryCreate(ctx context.Context
5050
repoID := d.Get("repository_id").(int)
5151

5252
repository := &github.Repository{
53-
ID: github.Ptr(int64(repoID)),
53+
ID: new(int64(repoID)),
5454
}
5555

5656
_, err := client.Actions.AddSelectedRepoToOrgSecret(ctx, owner, secretName, repository)
@@ -120,7 +120,7 @@ func resourceGithubActionsOrganizationSecretRepositoryDelete(ctx context.Context
120120
repoID := d.Get("repository_id").(int)
121121

122122
repository := &github.Repository{
123-
ID: github.Ptr(int64(repoID)),
123+
ID: new(int64(repoID)),
124124
}
125125
_, err := client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, owner, secretName, repository)
126126
if err != nil {

github/resource_github_actions_organization_variable.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ func resourceGithubActionsOrganizationVariableCreate(ctx context.Context, d *sch
8686
variable := &github.ActionsVariable{
8787
Name: varName,
8888
Value: d.Get("value").(string),
89-
Visibility: github.Ptr(visibility),
90-
SelectedRepositoryIDs: github.Ptr(repoIDs),
89+
Visibility: new(visibility),
90+
SelectedRepositoryIDs: new(repoIDs),
9191
}
9292
_, err := client.Actions.CreateOrgVariable(ctx, owner, variable)
9393
if err != nil {
@@ -193,8 +193,8 @@ func resourceGithubActionsOrganizationVariableUpdate(ctx context.Context, d *sch
193193
variable := &github.ActionsVariable{
194194
Name: varName,
195195
Value: d.Get("value").(string),
196-
Visibility: github.Ptr(visibility),
197-
SelectedRepositoryIDs: github.Ptr(repoIDs),
196+
Visibility: new(visibility),
197+
SelectedRepositoryIDs: new(repoIDs),
198198
}
199199

200200
_, err := client.Actions.UpdateOrgVariable(ctx, owner, variable)

github/resource_github_actions_organization_variable_repository.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func resourceGithubActionsOrganizationVariableRepositoryCreate(ctx context.Conte
5050
repoID := d.Get("repository_id").(int)
5151

5252
repository := &github.Repository{
53-
ID: github.Ptr(int64(repoID)),
53+
ID: new(int64(repoID)),
5454
}
5555

5656
_, err := client.Actions.AddSelectedRepoToOrgVariable(ctx, owner, variableName, repository)
@@ -120,7 +120,7 @@ func resourceGithubActionsOrganizationVariableRepositoryDelete(ctx context.Conte
120120
repoID := d.Get("repository_id").(int)
121121

122122
repository := &github.Repository{
123-
ID: github.Ptr(int64(repoID)),
123+
ID: new(int64(repoID)),
124124
}
125125
_, err := client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, owner, variableName, repository)
126126
if err != nil {

github/resource_github_actions_organization_variable_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ resource "github_actions_organization_variable" "test" {
361361
_, err = client.Actions.CreateOrgVariable(ctx, owner, &github.ActionsVariable{
362362
Name: varName,
363363
Value: "test",
364-
Visibility: github.Ptr("all"),
364+
Visibility: new("all"),
365365
})
366366
return err
367367
},

0 commit comments

Comments
 (0)