Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/groob/exec-template
Do useful things with go templates.
https://github.com/groob/exec-template
go golang utility
Last synced: 27 days ago
JSON representation
Do useful things with go templates.
- Host: GitHub
- URL: https://github.com/groob/exec-template
- Owner: groob
- Created: 2017-02-01T05:13:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-01T05:21:15.000Z (almost 8 years ago)
- Last Synced: 2024-08-03T12:01:34.958Z (3 months ago)
- Topics: go, golang, utility
- Language: Go
- Size: 1000 Bytes
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cloud-sec - exec-template - - Super simple go templater. (Other Awesome Lists / Non-CloudSec Stuff (TODO: move this elsewhere))
README
Execute arbitrary Go template using some JSON input.
# Example
```
./exec-template \
-json='{"Name": "groob", "Status": "active"}' \
-template='{{.Name}} is {{.Status}}.' \
-string
```Use the `-string` flag to specify wether the template is a path to a file or a string parameter like above.
# Install
If you have Go installed:
```
go get github.com/groob/exec-template
```Otherwise, you can download the binary from the [releases](https://github.com/groob/exec-template/releases) page.
# Usage
```
-json string
json input to use in template
-string
template is a string, not a file
-template string
path to template
```Go template tutorial: https://golang.org/pkg/text/template/