Skip to content

feat: Require Go 1.26 and use new(expr) for pointer literals - #4481

Open
ajayk wants to merge 2 commits into
google:masterfrom
ajayk:go-1.26
Open

feat: Require Go 1.26 and use new(expr) for pointer literals#4481
ajayk wants to merge 2 commits into
google:masterfrom
ajayk:go-1.26

Conversation

@ajayk

@ajayk ajayk commented Aug 23, 2026

Copy link
Copy Markdown

Bump go.mod to 1.26 per the N-1 support policy (Go 1.27 is current) and replace Ptr() with the new(v) builtin across tests.

  Bump go.mod to 1.26 per the N-1 support policy (Go 1.27 is current) and replace Ptr() with the new(v) builtin across tests.
@gmlewis

gmlewis commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

@ajayk - please read step 4 of CONTRIBUTING.md and run the scripts locally to fix all test and linter errors, then push the changes to this PR before we can proceed.

  Bump go.mod to 1.26 per the N-1 support policy (Go 1.27 is current) and replace Ptr() with the new(v) builtin across tests.
@ajayk

ajayk commented Aug 23, 2026

Copy link
Copy Markdown
Author

@ajayk - please read step 4 of CONTRIBUTING.md and run the scripts locally to fix all test and linter errors, then push the changes to this PR before we can proceed.

addressed them sorry about this !

➜  go-github git:(go-1.26) script/fmt.sh
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
WARN [formatter] gofumpt: `extra-rules` is deprecated, please use `extra.group-params` instead.
➜  go-github git:(go-1.26) script/test.sh
Testing modules

✔ .                                        [ PASS ]
✔ example                                  [ PASS ]
✔ otel                                     [ PASS ]
✔ scrape                                   [ PASS ]
✔ tools                                    [ PASS ]
✔ tools/check-structfield-settings         [ PASS ]
✔ tools/extraneousnew                      [ PASS ]
✔ tools/fmtpercentv                        [ PASS ]
✔ tools/paramcheck                         [ PASS ]
✔ tools/redundantptr                       [ PASS ]
✔ tools/sliceofpointers                    [ PASS ]
✔ tools/structfield                        [ PASS ]
----------------------------
Testing: issues found in 0 module directories.
--------------------------------------------
➜  go-github git:(go-1.26) script/lint.sh
Linting modules

✔ .                                        [ PASS ]
✔ example                                  [ PASS ]
✔ otel                                     [ PASS ]
✔ scrape                                   [ PASS ]
✔ tools                                    [ PASS ]
✔ tools/check-structfield-settings         [ PASS ]
✔ tools/extraneousnew                      [ PASS ]
✔ tools/fmtpercentv                        [ PASS ]
✔ tools/paramcheck                         [ PASS ]
✔ tools/redundantptr                       [ PASS ]
✔ tools/sliceofpointers                    [ PASS ]
✔ tools/structfield                        [ PASS ]
Validating generated files

✔ Generated files are up to date
----------------------------
Linting: issues found in 0 module directories.
--------------------------------------------

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Aug 23, 2026
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.51%. Comparing base (30af001) to head (5f86d04).

Files with missing lines Patch % Lines
github/github.go 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4481      +/-   ##
==========================================
- Coverage   98.51%   98.51%   -0.01%     
==========================================
  Files         195      195              
  Lines       17691    17685       -6     
==========================================
- Hits        17429    17423       -6     
  Misses        262      262              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis

gmlewis commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

I'm surprised the the Codecov report actually dropped in with this PR, but the bulk of the changes are for deprecated functions that are fixed with go:fix anyway, so I think we can safely ignore Codecov for this PR.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @ajayk!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @Not-Dhananjay-Mishra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants