Documentation
¶
Overview ¶
Package template renders Go templates against source/version data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuotedRefs ¶
QuotedRefs reports each root-derived action that IS piped through shellquote but sits inside a quoted string of the surrounding command: shellquote makes a word, and a word written inside "…" or '…' is no longer one — "$(id)" still substitutes, and '{{ x }}' closes the quote around a value holding one. Each is returned once, as text/template prints the action.
Quoting is followed through the template's text in document order, as sh reads it. ponytail: it does not know which branch of an if ran, so a template that opens a quote in one branch and closes it in another can be over- or under-reported.
func Render ¶
Render renders a Go template against data (typically map[string]any{"source": ..., "version": ...}).
func UnquotedRefs ¶
UnquotedRefs reports each action in tmpl that prints a value derived from one of roots (".version", ".args", ...) without ending in shellquote — the spots where a value reaches `sh -c` as shell syntax rather than as a word. Each is returned once, as text/template prints the action. An unparsable template reports nothing: rendering it fails louder than this could.
A value is derived from a root when it is reached through a field of it, through a dot rebound by with/range over it, or through a variable assigned from it. ponytail: variables are tracked by name across the whole template, not by scope — a shadowing $x can be over- or under-reported.
Types ¶
This section is empty.