16 lines
264 B
Go
16 lines
264 B
Go
package script
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
func Inject(script string, params map[string]string) string {
|
|
if params == nil {
|
|
return script
|
|
}
|
|
injected := script
|
|
for k, v := range params {
|
|
injected = strings.Replace(injected, "$$"+k, v, -1)
|
|
}
|
|
return injected
|
|
}
|