Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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"
- Host: GitHub
- URL: https://github.com/tompston/go-codegen-tutorial
- Owner: tompston
- Created: 2021-11-15T14:13:46.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-27T11:44:13.000Z (almost 3 years ago)
- Last Synced: 2024-12-06T09:26:18.125Z (2 months ago)
- Topics: go, golang, template
- Language: Go
- Homepage: https://tompston.pages.dev/writing/2021-11-15-guide-to-go-code-generation
- Size: 1.62 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-golang-repositories - go-codegen-tutorial
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 .
```