4 ms·
If "in a single file" means having your html and your javascript in your go file, that's not a feature...
by Pelican 7y ago
If "in a single file" means having your html and your javascript in your go file, that's not a feature...
- mdanger007 7y agoI prefer treating a template as a constant for small projects. Trade off is it doesn't scale but vastly reduces configuration overhead.
- photon_lines 7y agoI agree! The purpose of this was teaching, and not necessarily following all of the best practices! I made raw files which contain the go HTML templates, as well as the JS and CSS files available within the repository in case anyone wanted to reference these instead of including the raw code within main.go!!
- whateveracct 7y agoYeah..the Haskell one recently at least had the HTML in a Haskell EDSL instead of raw strings.