Skip to content

Use subtemplate #1014

Answered by hairyhenderson
Tindome asked this question in Q&A
Dec 22, 2020 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @Tindome, thanks for logging this. I've converted it to a discussion since it fits better here.

I don't think you need to use file.Read or tmpl.Exec here at all - it looks like the external nested templates feature (i.e. --template/-t) should work for you:

$ gomplate -t color_definition=./tpl/color_definition.tpl -d sessions=./params.json -f makefile.tpl -o makefile

Does that help?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tindome
Comment options

Answer selected by Tindome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1014 on December 22, 2020 18:15.