Use the html/template package . It's a good idea to go through the documentation of the standard lib once and to see what packages it provides. In fact, with Go the knowledge of the std lib is as important knowing any other features of the language.
Le dimanche 7 août 2016 23:51:05 UTC+2, Paulo Janeiro a écrit : > > Coming from another language, I'm starting to port a web app to Go using > default packages to test-drive it but I couldn't find any > standard/recommended way of using pre-defined HTML components that I could > use in HTML pages and inside other components. > > Specifically, is there a recommended pattern on how to use a component > inside another component inside another component passing data to each one > in a transparent way? > As far as I understand Go differentiates itself from other languages > because you don't need to use a Web framework and rather use default > API/middleware. But when it comes to reusable templates/components (and > also layouts) I don't see an immediate parallel. > > Could someone point me in the correct direction? > Thanks. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.