gogcli/docs/refactor/templates.md
2025-12-26 20:39:54 +01:00

645 B

summary read_when
googleauth templates via `//go:embed`
Editing auth UI
Touching template parsing/escaping issues

googleauth templates (embed)

Problem: huge templates*.go files, noisy diffs, hard to edit.

Current setup

  • HTML lives in internal/googleauth/templates/*.html
  • Go glue in internal/googleauth/templates_embed.go (//go:embed)
  • Variable names preserved:
    • accountsTemplate
    • successTemplateNew
    • successTemplate
    • errorTemplate
    • cancelledTemplate

Editing flow

  • Edit the HTML files directly.
  • Run go test ./... to confirm templates parse + execute (tests cover this).