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

https://github.com/abcum/tmpl

A template parser and compiler for Go
https://github.com/abcum/tmpl

generator go golang golang-tools template-processor

Last synced: 3 months ago
JSON representation

A template parser and compiler for Go

Awesome Lists containing this project

README

          

# tmpl

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

[![](https://img.shields.io/circleci/token/acab5a4d494bbdf0c97c4636063cc3d5d601bdac/project/abcum/tmpl/master.svg?style=flat-square)](https://circleci.com/gh/abcum/tmpl) [![](https://img.shields.io/badge/status-alpha-ff00bb.svg?style=flat-square)](https://github.com/abcum/tmpl) [![](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/abcum/tmpl) [![](https://goreportcard.com/badge/github.com/abcum/tmpl?style=flat-square)](https://goreportcard.com/report/github.com/abcum/tmpl) [![](https://img.shields.io/badge/license-Apache_License_2.0-00bfff.svg?style=flat-square)](https://github.com/abcum/tmpl)

#### 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

```bash
go get github.com/abcum/tmpl
```

#### Usage

```bash
tmpl -file data.json file1.go.tmpl file2.go.tmpl
```

```bash
tmpl -data '["foo","bar","baz"]' file1.go.tmpl file2.go.tmpl
```