Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move templates from rakyll/statik to go:embed #1444

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

paskal
Copy link
Sponsor Collaborator

@paskal paskal commented Jul 27, 2022

There is no need for the rakyll/statik package starting with Go 1.16, which provides us with tools for embedding files without third-party libraries.

I've verified that binary reads files from the disk in case they are present with the same name as embedded ones. Changes in files are immediately seen on the page after refresh. To verify, try opening http://127.0.0.1:8080/email/unsubscribe.html and putting file error_response.html.tmpl next to the library and altering it.

@paskal paskal added the backend label Jul 27, 2022
@paskal paskal requested a review from akellbl4 July 27, 2022 00:52
@paskal paskal requested a review from umputun as a code owner July 27, 2022 00:52
@paskal paskal force-pushed the paskal/go_embed_templates branch 3 times, most recently from c1880e2 to a1bd81f Compare July 27, 2022 17:07
backend/app/templates/templates.go Outdated Show resolved Hide resolved
backend/app/rest/api/rest_private_test.go Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@paskal paskal force-pushed the paskal/go_embed_templates branch 3 times, most recently from 30e4f01 to 0dc9350 Compare July 27, 2022 23:49
There is no need for the rakyll/statik package starting with Go 1.16,
which provides us with tools for embedding files
without third-party libraries.
@paskal paskal force-pushed the paskal/go_embed_templates branch from 0dc9350 to c25a239 Compare July 28, 2022 18:30
@paskal paskal merged commit 86d059b into master Jul 29, 2022
@paskal paskal deleted the paskal/go_embed_templates branch July 29, 2022 17:07
@paskal paskal added this to the v1.10.2 milestone Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants