You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
267 B
V
13 lines
267 B
V
2 years ago
|
module template
|
||
|
|
||
2 years ago
|
pub fn parse(template string, target map[string]string) string {
|
||
|
mut content := template
|
||
|
for key in target.keys() {
|
||
|
at_key := '@' + key
|
||
|
value := target[key]
|
||
|
// assign to content
|
||
|
content = content.replace(at_key, value)
|
||
|
}
|
||
|
return content
|
||
2 years ago
|
}
|