Documentation
¶
Index ¶
- func CheckHasVar(str string) bool
- func ConvertDollarPlaceholder(sql, dbType string) string
- func ProcessVar(pattern, key string, val interface{}) string
- func RandomStr(num int) string
- func RemoveBraces(s string) string
- func SprintfDict(pattern string, dict map[string]interface{}) string
- func ToString(input interface{}) string
- func ToStringMapString(input interface{}) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDollarPlaceholder ¶
ConvertDollarPlaceholder 转postgres风格占位符
func ProcessVar ¶
func RemoveBraces ¶
RemoveBraces A function that takes a string with ${} and returns a string without them
func SprintfDict ¶
SprintfDict formats a string according to a pattern and a dictionary of variables. The pattern is a string that contains placeholders for the variables in the form of ${key}. The dict is a map from keys to values that will replace the placeholders. For example, SprintfDict(“Hello, ${name}!”, map[string]string{“name”: “Alice”}) returns “Hello, Alice!”. If the pattern contains a key that is not in the dict, it will be left unchanged. If the dict contains a key that is not in the pattern, it will be ignored.
func ToStringMapString ¶
func ToStringMapString(input interface{}) map[string]interface{}
ToStringMapString 把interface类型 转 map[string]string类型
Types ¶
This section is empty.