Skip to content

refactor: move error templates to internal/templates#2418

Merged
paganotoni merged 1 commit intomainfrom
move-error-templates
Mar 20, 2026
Merged

refactor: move error templates to internal/templates#2418
paganotoni merged 1 commit intomainfrom
move-error-templates

Conversation

@paganotoni
Copy link
Member

Summary

Move error page templates from root to internal/templates/ and co-locate the embed variables in errors.go where they're used.

Changes

  • Moved error.dev.html, error.prod.html, notfound.prod.html from root to internal/templates/
  • Deleted error_templates.go
  • Added embed directives directly in errors.go where the variables are used

Rationale

This co-locates the templates with the code that uses them, following Go best practices for internal packages. It also cleans up the root directory by moving implementation details to an internal package.

Verification

  • Build passes: go build ./...
  • Templates are correctly embedded via //go:embed directives
  • No functional changes - error pages work as before

Move error page templates from root to internal/templates/ and
co-locate the embed variables in errors.go where they're used.

Changes:
- Moved error.dev.html, error.prod.html, notfound.prod.html to internal/templates/
- Deleted error_templates.go
- Added embed directives directly in errors.go where the variables are used
@paganotoni paganotoni requested a review from a team as a code owner March 20, 2026 14:07
@paganotoni paganotoni merged commit 95a85b0 into main Mar 20, 2026
8 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.

1 participant