Skip to content
 
 

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Go Command Line Template

Use Go templates to build config files.

Installation

  1. Make sure you have Go installed on your machine. https://go.dev/dl/
  2. Make sure that the bin directory of your GOPATH is in $PATH
export PATH=$PATH:~/go/bin
  1. $ go install github.com/sittercity/go-cli-template@latest

Usage

Example template in app.yaml.tmpl:

service: {{.service}}

Variables from environment:

$ export service=foo
$ go-cli-template app.yaml.tmpl
service: foo

Variables from command line:

$ go-cli-template --service=foo app.yaml.tmpl
service: foo

Override environment variables with command line:

$ export service=foo
$ go-cli-template --service=bar app.yaml.tmpl
service: bar

Template from STDIN:

$ echo 'service: {{.service}}' | go-cli-template --service=foo -
service: foo

About

Go command line templates

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages