Skip to content

Apply go modernize#351

Merged
JoTurk merged 1 commit intopion:masterfrom
tmatth:apply-modernize
Mar 5, 2026
Merged

Apply go modernize#351
JoTurk merged 1 commit intopion:masterfrom
tmatth:apply-modernize

Conversation

@tmatth
Copy link
Contributor

@tmatth tmatth commented Jan 9, 2026

Applied with

go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test *.go

N.B. ranging over constants requires go >= 1.22 and testing.Loop requires go1.24 or later.

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.59%. Comparing base (b13b677) to head (d6ee424).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #351   +/-   ##
=======================================
  Coverage   82.59%   82.59%           
=======================================
  Files          28       28           
  Lines        3430     3430           
=======================================
  Hits         2833     2833           
  Misses        427      427           
  Partials      170      170           
Flag Coverage Δ
go 82.59% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@tmatth tmatth added the blocked label Jan 9, 2026
@JoTurk JoTurk marked this pull request as draft January 9, 2026 15:16
@Sean-Der
Copy link
Member

Sean-Der commented Jan 9, 2026

Nice changes @tmatth

Worth adding to ci? Could we use an older version of the tool that doesn't to an upgrade?

@JoTurk
Copy link
Member

JoTurk commented Jan 9, 2026

@Sean-Der we can use it with golangci-lint, but last time i checked, it cased some conflicts with some linters (gosec?), also i'll check how to set it so it doesn't try to force us to update Go version, I'm going to check again after the fact we upgraded golangci-lint to 2.6.

@JoTurk
Copy link
Member

JoTurk commented Jan 9, 2026

@Sean-Der
Copy link
Member

Sean-Der commented Jan 9, 2026

Oh that's nice @JoTurk it's pretty wild how much 'Good Go Code' has changed.

Especially in pion/turn it feels like a time portal :)

@JoTurk JoTurk marked this pull request as ready for review March 5, 2026 12:06
@JoTurk JoTurk force-pushed the apply-modernize branch from d98a350 to a98894b Compare March 5, 2026 12:10
@JoTurk JoTurk force-pushed the apply-modernize branch from a98894b to d6ee424 Compare March 5, 2026 12:10
Copy link
Member

@JoTurk JoTurk left a comment

Choose a reason for hiding this comment

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

tyty, we upgraded to 1.24 weeks ago.

@JoTurk
Copy link
Member

JoTurk commented Mar 5, 2026

@Sean-Der,

@lanc07 added modernize to our lint and he's going to apply it to all the repos :)

@JoTurk JoTurk removed the blocked label Mar 5, 2026
@JoTurk JoTurk merged commit e119a01 into pion:master Mar 5, 2026
17 of 18 checks passed
@tmatth tmatth deleted the apply-modernize branch March 5, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants