Documentation
¶
Overview ¶
Package interpolate substitutes "{{name}}" placeholders with variable values. It doesn't care where the values come from -- a file-scoped declaration, an environment, a script -- callers just hand it a resolved map[string]string.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply replaces every "{{name}}" placeholder in s with vars[name]. A placeholder whose name isn't in vars is left untouched in the result and its name is added to missing, in first-occurrence order with duplicates removed.
func ApplyURL ¶
ApplyURL is like Apply, but for URLs: a "{{name}}" placeholder that lands inside a query parameter's value is percent-encoded, so a value like "Hello again" becomes "Hello%20again" instead of a literal space corrupting the request line on the wire. Placeholders anywhere else -- the scheme, host, or path -- are substituted raw, since a URL commonly builds its authority from a variable (e.g. "{{host}}/get") and that shouldn't be escaped the way a leaf value would be.
Types ¶
This section is empty.