Skip to content

Commit

Permalink
using § marker - Closes #347
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Oct 11, 2020
1 parent 83aef7e commit 236f3b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion v2/pkg/requests/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ import (
"strings"
)

const (
MARKER_PARENTHESIS_OPEN = "{{"
MARKER_PARENTHESIS_CLOSE = "}}"
MARKER_GENERAL = "§"
)

func newReplacer(values map[string]interface{}) *strings.Replacer {
var replacerItems []string
for k, v := range values {
replacerItems = append(replacerItems, fmt.Sprintf("{{%s}}", k), fmt.Sprintf("%s", v), k, fmt.Sprintf("%s", v))
replacerItems = append(replacerItems, fmt.Sprintf("%s%s%s", MARKER_PARENTHESIS_OPEN, k, MARKER_PARENTHESIS_CLOSE), fmt.Sprintf("%s", v))
replacerItems = append(replacerItems, fmt.Sprintf("%s%s%s", MARKER_GENERAL, k, MARKER_GENERAL), fmt.Sprintf("%s", v))
}

return strings.NewReplacer(replacerItems...)
Expand Down

0 comments on commit 236f3b2

Please sign in to comment.