Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tompston/go-codegen-tutorial

4 minimal examples of codegen with "text/template"
https://github.com/tompston/go-codegen-tutorial

go golang template

Last synced: 10 days ago
JSON representation

4 minimal examples of codegen with "text/template"

Awesome Lists containing this project

README

        

# Codegen Examples with Go `text/template` package

## [Link to post](https://tompston.pages.dev/writing/2021-11-15-guide-to-go-code-generation)

- 01 generating templates with data
- 02 creating variables inside templates
- 03 passing down and using functions inside templates
- 04 embedding the templates into the binary

```bash
# to build the binary run
GOOS=linux go build -o main .
```