Builders 101

Why builders?

  1. Writing markup in pure go (or another non DSL) is slow and unpleasant
  2. You want to use css preprocessor like sass
  3. Manage static files (index.html, images, icons)

To make writing and building easier I recommend use builder pattern.

Main ideas

You build your application by your script in golang. It allow you to build application like you want, for example: custom css preprocessor, another parser, custom builder, custom static file server, e.t.c.

For routine tasks (created/edit/delete files, directories) you can use github.com/gascore/gasx library. It's also have *.gos parser, css atomizer, html2gas compiler.

Golang special syntax — GOS

Like JSX, but for go

You can write markup in pure go, but if you code big a lot of markup your code will be terrible and unreadable. And you will code a lot of markup, because it's web.

For solve this problem you can use GOS — golang superset with special blocks (SB).

SB allows you to write code on any DSL to be compiled into golang.

SB syntax: $sb_name{...some code...}$.

How to

  1. Find *.gos (or another extension which you want) files by gasx.GasFiles: