Обложка канала

Библиотека Go разработчика

8531 @goproglib

Полезные материалы по всему, что может быть полезно разработчику на Go.

Библиотека Go разработчика

4 года назад
Открыть в
Быстрые встроенные шаблоны в Go quicktemplate — шаблонизатор в Go, который отличается от предлагаемого стандартной библиотекой механизма шаблонов тем, что каждый шаблон преобразуется в Go-код, а затем компилируется. Быстрое введение в инструмент на примере создания HTML-страниц в статье. 🔽 Читать
Fast embedded templates in Go with quicktemplate

Go is known for having a pretty extensive standard library, it's one of the things I like most about the language. This includes a templating library for generating either textual or HTML output, against a set of provided data. What with the latter being highly useful in the development of web applications wherein you would want to generate secure HTML. With embed, you can have your HTML templates bundled within the binary, meaning at deployment time you don't have to worry about managing additional files, reducing the administrative overhead. Today, I would like to demonstrate another approach to achieving this however, using a different templating language that generates Go code for generating the templates, and allows for generating minified all-in-one HTML pages with ease.

Andrewpillar