Skip to content

refactor(gen): modernize generated go (any, gofumpt) - #280

Merged
cbrgm merged 2 commits into
mainfrom
phase-2-modern-go
Aug 12, 2026
Merged

refactor(gen): modernize generated go (any, gofumpt)#280
cbrgm merged 2 commits into
mainfrom
phase-2-modern-go

Conversation

@cbrgm

@cbrgm cbrgm commented Aug 12, 2026

Copy link
Copy Markdown
Owner

What

Mechanical Go modernization of the generated code, plus formatting-tool consistency.

  • interface{} -> any in the runtime template
  • drop the redundant callbacks == nil || len(callbacks) == 0 checks (a nil slice has len 0)
  • standardize on gofumpt across the generator, make format, and lint (they disagreed before: generator used gofmt -s, make format used go fmt, lint wanted gofumpt). Generator now formats in-process via go/format, make generate/make format run 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. any is an alias for interface{}, 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-code clean and idempotent with pinned gofumpt
  • grep -rl 'interface{}' githubevents/ and grep -rl 'callbacks == nil' githubevents/ -> empty
  • make test green, make apidiff -> API compatible, golangci-lint 0 issues

Checklist

  • Tests added/updated (existing generated suite exercises the changed handlers; no new behavior)
  • No breaking changes (any is an alias, checks are behavior-identical, apidiff compatible)
  • Readable commit history (2 commits: format, then any/checks)
  • AI code review considered and comments resolved

Base automatically changed from phase-0-apidiff-gate to main August 12, 2026 12:47
cbrgm added 2 commits August 12, 2026 14:49
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
cbrgm force-pushed the phase-2-modern-go branch from 2c3a05e to b40c7ea Compare August 12, 2026 12:49
@cbrgm
cbrgm merged commit 3bf0673 into main Aug 12, 2026
4 checks passed
@cbrgm
cbrgm deleted the phase-2-modern-go branch August 12, 2026 12:51
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.

1 participant