2015-04-25 19:05:26 +00:00
|
|
|
package mysql
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Query templates a query for us.
|
|
|
|
func Query(tpl string, data map[string]string) string {
|
|
|
|
for k, v := range data {
|
2022-08-03 19:22:48 +00:00
|
|
|
tpl = strings.ReplaceAll(tpl, fmt.Sprintf("{{%s}}", k), v)
|
2015-04-25 19:05:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return tpl
|
|
|
|
}
|