Skip to content

Commit 24e23be

Browse files
committed
Fix linter
Signed-off-by: Timo Sand <[email protected]>
1 parent eaaf0d7 commit 24e23be

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

github/resource_github_repository_pages.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strconv"
88
"strings"
99

10-
"github.com/google/go-github/v83/github"
10+
"github.com/google/go-github/v84/github"
1111
"github.com/hashicorp/terraform-plugin-log/tflog"
1212
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff"
@@ -176,15 +176,15 @@ func resourceGithubRepositoryPagesCreate(ctx context.Context, d *schema.Resource
176176
update := &github.PagesUpdate{}
177177

178178
if cnameOK {
179-
update.CNAME = github.Ptr(cname.(string))
179+
update.CNAME = new(cname.(string))
180180
}
181181

182182
if publicOKExists {
183-
update.Public = github.Ptr(public.(bool))
183+
update.Public = new(public.(bool))
184184
}
185185

186186
if httpsEnforcedExists {
187-
update.HTTPSEnforced = github.Ptr(httpsEnforced.(bool))
187+
update.HTTPSEnforced = new(httpsEnforced.(bool))
188188
}
189189

190190
_, err = client.Repositories.UpdatePages(ctx, owner, repoName, update)
@@ -288,27 +288,27 @@ func resourceGithubRepositoryPagesUpdate(ctx context.Context, d *schema.Resource
288288
if d.HasChange("cname") {
289289
cname := d.Get("cname").(string)
290290
if cname != "" {
291-
update.CNAME = github.Ptr(cname)
291+
update.CNAME = new(cname)
292292
}
293293
}
294294

295295
if d.HasChange("public") {
296296
public, ok := d.Get("public").(bool)
297297
if ok {
298-
update.Public = github.Ptr(public)
298+
update.Public = new(public)
299299
}
300300
}
301301

302302
if d.HasChange("https_enforced") {
303303
httpsEnforced, ok := d.Get("https_enforced").(bool)
304304
if ok {
305-
update.HTTPSEnforced = github.Ptr(httpsEnforced)
305+
update.HTTPSEnforced = new(httpsEnforced)
306306
}
307307
}
308308

309309
if d.HasChange("build_type") {
310310
buildType := d.Get("build_type").(string)
311-
update.BuildType = github.Ptr(buildType)
311+
update.BuildType = new(buildType)
312312
}
313313

314314
if d.HasChange("source") || d.HasChange("build_type") {
@@ -403,7 +403,7 @@ func expandPagesForCreate(d *schema.ResourceData) *github.Pages {
403403
pages := &github.Pages{}
404404

405405
buildType := d.Get("build_type").(string)
406-
pages.BuildType = github.Ptr(buildType)
406+
pages.BuildType = new(buildType)
407407

408408
if buildType == "legacy" {
409409
if source, ok := d.GetOk("source"); ok {
@@ -412,18 +412,18 @@ func expandPagesForCreate(d *schema.ResourceData) *github.Pages {
412412
sourceMap := sourceList[0].(map[string]any)
413413
branch := sourceMap["branch"].(string)
414414
pagesSource := &github.PagesSource{
415-
Branch: github.Ptr(branch),
415+
Branch: new(branch),
416416
}
417417
if path, ok := sourceMap["path"].(string); ok && path != "" && path != "/" {
418-
pagesSource.Path = github.Ptr(path)
418+
pagesSource.Path = new(path)
419419
}
420420
pages.Source = pagesSource
421421
}
422422
}
423423
// Default to main branch if no source specified
424424
if pages.Source == nil {
425425
pages.Source = &github.PagesSource{
426-
Branch: github.Ptr("main"),
426+
Branch: new("main"),
427427
}
428428
}
429429
}

0 commit comments

Comments
 (0)