-
Notifications
You must be signed in to change notification settings - Fork 0
Design Doc
fall simply edited this page Dec 19, 2020
·
2 revisions
Template
Hello, I'm {{name}} from {{City}}, {{from_state}}
Regular Expression
Hello, I'm (?P<name>.*) from (?P<City>.*), (?P<from_state>.*)
Method Header
func (t Template) Pull(input string) map[string]interface{}
Input
Hello, I'm John from Dallas, TX
Output
{
name: "John",
City: "Dallas",
from_state: "TX"
}
Template to Regex - Regex101
String to Data - Regex101
Method Header
func (t Template) Populate(data map[string]interface{}) string
Template
Hello, I'm {{name}} from {{City}}, {{from_state}}
Input
{
name: "John",
City: "Dallas",
from_state: "TX"
}
Output
Hello, I'm John from Dallas, TX