Skip to content

refactor(context): rewrite context code generator from Perl to Go#661

Merged
camathieu merged 1 commit into
masterfrom
refactor/context-codegen-go
Mar 1, 2026
Merged

refactor(context): rewrite context code generator from Perl to Go#661
camathieu merged 1 commit into
masterfrom
refactor/context-codegen-go

Conversation

@camathieu
Copy link
Copy Markdown
Member

What

Replace the Perl code generator (gen.pl) with an idiomatic Go equivalent (gen.go) using text/template.

Why

Removes the Perl dependency from the project toolchain. The Go version is testable — TestGenContextUpToDate verifies the generated output stays in sync with context.go during make test.

Changes

  • Delete gen.pl, add gen.go with //go:build ignore
  • Move GetAuthenticatorSafe() from generated context.go to hand-written admin.go
  • Add TestGenContextUpToDate — runs go run gen.go and diffs against context.go

Testing

  • make lint ✅, make client server ✅, make vuln
  • TestGenContextUpToDate passes (0.05s)

Replace gen.pl with gen.go using text/template for idiomatic Go
code generation. Move hand-written GetAuthenticatorSafe() from
generated context.go to admin.go. Add TestGenContextUpToDate to
catch gen.go / context.go drift in CI.
@camathieu camathieu merged commit 43392b4 into master Mar 1, 2026
7 checks passed
@camathieu camathieu deleted the refactor/context-codegen-go branch March 7, 2026 11:12
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