/tmpl

A template parser and compiler for Go

Primary LanguageGoApache License 2.0Apache-2.0

tmpl

A command line tool for parsing and generating template files for Go (Golang).

Features

  • Generate files from templates
  • Useful for go:generate commands
  • Accepts data as json or from a file
  • Templates are processed and compiled
  • Process and compile multiple templates at once

Installation

go get github.com/abcum/tmpl

Usage

tmpl -file data.json file1.go.tmpl file2.go.tmpl
tmpl -data '["foo","bar","baz"]' file1.go.tmpl file2.go.tmpl