Skip to content

feat: embed error.html template and move loading to main#10

Merged
emsearcy merged 1 commit into
mainfrom
feat/embed-error-template
Oct 20, 2025
Merged

feat: embed error.html template and move loading to main#10
emsearcy merged 1 commit into
mainfrom
feat/embed-error-template

Conversation

@emsearcy

Copy link
Copy Markdown
Contributor
  • Bundle error.html template using go:embed for self-contained binaries
  • Move template loading from init() to main() after logging setup
  • Remove template file copy from Dockerfile since templates are embedded
  • Add proper error template initialization with structured logging
  • Support ko builds with no external file dependencies
  • Remove template copy from Dockerfile

🤖 Generated with GitHub Copilot (via Zed)

- Bundle error.html template using go:embed for self-contained binaries
- Move template loading from init() to main() after logging setup
- Remove template file copy from Dockerfile since templates are embedded
- Add proper error template initialization with structured logging
- Support ko builds with no external file dependencies
- Remove template copy from Dockerfile

🤖 Generated with GitHub Copilot (via Zed)

Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
Copilot AI review requested due to automatic review settings October 20, 2025 21:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR embeds the error.html template directly into the binary using go:embed, eliminating the need for external template files at runtime. This change enables self-contained builds (like ko) and simplifies deployment.

Key changes:

  • Template content is now embedded at compile time using go:embed directive
  • Template initialization moved from init() to main() to ensure proper logging context
  • Dockerfile no longer needs to copy template files since they're embedded in the binary

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
responses.go Adds go:embed directive to bundle error.html template and refactors template initialization into a callable function
main.go Calls initErrorTemplate() after logging setup to ensure template errors are properly logged
Dockerfile Removes template file copy step since templates are now embedded in the binary

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@emsearcy emsearcy merged commit e87eac5 into main Oct 20, 2025
4 checks passed
@emsearcy emsearcy deleted the feat/embed-error-template branch October 20, 2025 21:16
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.

2 participants