Prettier printing.
This commit is contained in:
parent
8a218f35c0
commit
467d1d3d44
5 changed files with 73 additions and 26 deletions
|
|
@ -196,14 +196,14 @@ func expandSigils(input string, vars map[string][]string) []string {
|
|||
func expandRecipeSigils(input string, vars map[string][]string) string {
|
||||
expanded := ""
|
||||
for i := 0; i < len(input); {
|
||||
j := strings.IndexAny(input[i:], "$\\")
|
||||
if j < 0 {
|
||||
off := strings.IndexAny(input[i:], "$\\")
|
||||
if off < 0 {
|
||||
expanded += input[i:]
|
||||
break
|
||||
}
|
||||
expanded += input[i : i+off]
|
||||
i += off
|
||||
|
||||
expanded += input[i:j]
|
||||
i = j
|
||||
c, w := utf8.DecodeRuneInString(input[i:])
|
||||
if c == '$' {
|
||||
i += w
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue