Skip to content

Code modernizations via go fix + manual follow-up#6746

Merged
sorindumitru merged 5 commits intospiffe:mainfrom
c4rlo:go-fix
Mar 26, 2026
Merged

Code modernizations via go fix + manual follow-up#6746
sorindumitru merged 5 commits intospiffe:mainfrom
c4rlo:go-fix

Conversation

@c4rlo
Copy link
Contributor

@c4rlo c4rlo commented Mar 14, 2026

Modernize code using go fix.

On top of that, manually complete a couple of migrations that go fix couldn't fully do on its own:

  • Switching to (sync.WaitGroup).Go() wherever possible (and fixing some minor race conditions in the process).
  • Switching to new(value) expressions (as introduced in Go 1.26) instead of using helper functions for this.

This change is structured into individual commits that make clear which parts were done automatically via go fix (and hence should need less scrutiny).

@c4rlo c4rlo marked this pull request as ready for review March 14, 2026 12:29
@MarcosDY MarcosDY self-assigned this Mar 17, 2026
MarcosDY
MarcosDY previously approved these changes Mar 23, 2026
Copy link
Collaborator

@MarcosDY MarcosDY left a comment

Choose a reason for hiding this comment

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

This looks great!, Can you rebase?

c4rlo added 5 commits March 25, 2026 19:28
Excluding only changes made to

- pkg/server/endpoints/bundle/internal/acmetest/ca.go
- pkg/server/endpoints/bundle/internal/autocert/autocert.go

As this is effectively "vendored" code.

Signed-off-by: Carlo Teubner <cteubner1@bloomberg.net>
Signed-off-by: Carlo Teubner <cteubner1@bloomberg.net>
Finish the job that "go fix" started with this.

Signed-off-by: Carlo Teubner <cteubner1@bloomberg.net>
Our current staticcheck version is too old to know about the
"new(value)" construct and gets confused by it.

As it happens, we can slightly simplify the code here anyway.

Signed-off-by: Carlo Teubner <cteubner1@bloomberg.net>
Finish the job that "go fix" started with this.

This actually includes some race conditions fixes, where we were
previously calling "wg.Add" inside the goroutine, when we should
have been calling it before spawning the goroutine.

Signed-off-by: Carlo Teubner <cteubner1@bloomberg.net>
@c4rlo
Copy link
Contributor Author

c4rlo commented Mar 25, 2026

This looks great!, Can you rebase?

Done.

@MarcosDY MarcosDY added this to the 1.15.0 milestone Mar 25, 2026
@sorindumitru sorindumitru added this pull request to the merge queue Mar 26, 2026
Merged via the queue into spiffe:main with commit 0b91c01 Mar 26, 2026
50 checks passed
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