[Chapter 1] templateHandler sync.Once
dafeng opened this issue · 2 comments
dafeng commented
when I use sync.Once to compile the template, if I edit the template page I have to rerun the program, then I can see the update in the template page.
thalesfsp commented
@dafeng This is the expected behavior since it implements the Singleton pattern.
matryer commented
@thalesfsp is right, if you want live reloading of templates, you could load it every time, but it'll be slower. Check out https://github.com/pilu/fresh for a dev-time solution you might like.