Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/freeformz/go-templates

Go Template Examples
https://github.com/freeformz/go-templates

Last synced: 7 days ago
JSON representation

Go Template Examples

Awesome Lists containing this project

README

        

# GO Template Examples

## Shared templates

```console
$ go run ./shared
Template from a.gotmpl is named "a.gotmpl"
Template from b.gotmpl is named "b.gotmpl"
Template defined inside of b.gotmpl is named "bb"
Output of Executing 'a'
-------------------------------------------

template "a.gotmpl" text

template "bb" text (inside of "b.gotmpl")

template "b.gotmpl" text

Output of Executing 'a' the second time
-------------------------------------------

template "a.gotmpl" text

template "bb" text (inside of "b.gotmpl")

template "b.gotmpl" text

```

Note: Peek inside of ["./shared/templates/a.gotmpl"](https://github.com/freeformz/go-templates/blob/master/shared/templates/a.gotmpl)