gotpl

command module
v0.0.0-...-1e9050b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

README

gotpl - CLI tool for Golang templates

Command line tool that compiles Golang templates with values from YAML files.

Install

go get github.com/jgensler8/gotpl

Usage

Contents of template:

Hello, {{.name}}. A friendly reminder that {{.note.json}}

Contents of input.yaml

---
name: <yourname>
note: {
  "json": "json is valid yaml! :)"
}
$ ./gotpl -data examples/input/input.yaml -template examples/input/template.tmpl
Hello, <yourname>. A friendly reminder that json is valid yaml! :)

Dockerfile

GOOS=linux go build
docker build -t gotpl .
docker run -v "$PWD/examples/input/input.yaml:/input/data" -v "$PWD/examples/input/template.tmpl:/input/template"  gotpl

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL