Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parsed ¶
type Parsed []part
Parsed is a parsed string.
func Parse ¶
Parse parses the string and returns a parsed representation. The variables may be interpolated later using the Interpolate method.
The syntax is similar to shell variable expansion. The following rules apply:
- Variables are enclosed in ${...} and may contain any character.
- Variables may have a default value separated by -, eq. ${VAR-default}.
- To include a literal $, escape it with a backslash, eq. \$.
- If a variable is not closed, it is treated as a literal.
func ParsePercent ¶
ParsePercent parses the string and returns a parsed representation. The variables may be interpolated later using the Interpolate method.
The syntax is similar to shell variable expansion. The following rules apply:
- Variables are enclosed in %{...} and may contain any character.
- Variables may have a default value separated by -, eq. %{VAR-default}.
- To include a literal %, escape it with a backslash, eq. \%.
- If a variable is not closed, it is treated as a literal.