go-template

command module
v0.0.0-...-831c948 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-template

A lightweight CLI tool for rendering templates using Go's text/template engine with Sprig functions.

Features

  • Process templates from files or standard input
  • Inject parameters from YAML files
  • Full support for Sprig template functions
  • Simple, focused interface

Installation

go install github.com/conao3/go-template@latest

Or build from source:

git clone https://github.com/conao3/go-template.git
cd go-template
go install .

Usage

go-template -i <template-file> [-p <params-file>]
Options
Flag Description
-i, --input Input template file (use - for stdin)
-p, --param YAML file containing template parameters
Examples

Basic template rendering:

$ go-template -i sample/01_simple.yml
- a
- b
- c

Using range to iterate:

$ go-template -i sample/02_range.yml
- 0
- 1
- 2
- 3
- 4

Injecting values from a parameter file:

$ go-template -i sample/03_injection.yml -p sample/03_injection.val.yml
[1 2 3]

$ go-template -i sample/03_injection_list.yml -p sample/03_injection.val.yml
- item_1
- item_2
- item_3

License

See LICENSE for details.

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