mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-24 07:31:53 +08:00
13 lines
226 B
Go
13 lines
226 B
Go
package rule
|
|
|
|
import "strings"
|
|
|
|
func CompileTpl(tpl string, vars map[string]string) (compiled string) {
|
|
compiled = tpl
|
|
for n, v := range vars {
|
|
compiled = strings.ReplaceAll(compiled, "${"+n+"}", v)
|
|
}
|
|
|
|
return compiled
|
|
}
|