refactor(gen): modernize generated go (any, gofumpt) - #280
Merged
Conversation
4 tasks
replace exec-based gofmt call in gen/format.go with go/format, so the generator formats in-process instead of shelling out. make format and make generate now run gofumpt -extra over gen and githubevents, matching what golangci-lint expects. repo was already gofumpt v0.7.0 clean, so no output diff.
cbrgm
force-pushed
the
phase-2-modern-go
branch
from
August 12, 2026 12:49
2c3a05e to
b40c7ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Mechanical Go modernization of the generated code, plus formatting-tool consistency.
interface{}->anyin the runtime templatecallbacks == nil || len(callbacks) == 0checks (a nil slice has len 0)make format, and lint (they disagreed before: generator usedgofmt -s,make formatusedgo fmt, lint wanted gofumpt). Generator now formats in-process viago/format,make generate/make formatrun pinned gofumpt v0.7.0.Stacked on #279.
Why
Small, safe cleanups that make the generated code read like modern Go and stop the three formatters from fighting.
anyis an alias forinterface{}, so the public API is untouched (apidiff confirms). The generated tree turned out to be already gofumpt-clean, so the reformat produced no churn.Testing
make generate->git diff --exit-codeclean and idempotent with pinned gofumptgrep -rl 'interface{}' githubevents/andgrep -rl 'callbacks == nil' githubevents/-> emptymake testgreen,make apidiff-> API compatible, golangci-lint 0 issuesChecklist
anyis an alias, checks are behavior-identical, apidiff compatible)