This function will replace all type casts in the query with the corresponding type cast in the simpleStringsConversion map.
(sql string)
| 344 | } |
| 345 | simpleStrMatchingRegex = regexp.MustCompile(`(?i)(` + strings.Join(simpleStrings, "|") + `)`) |
| 346 | }) |
| 347 | return simpleStrMatchingRegex |
| 348 | } |
| 349 | |
| 350 | // This function will replace all type casts in the query with the corresponding type cast in the simpleStringsConversion map. |
| 351 | func SimpleStrReplacement(sql string) string { |
| 352 | return getSimpleStringMatchingRegex().ReplaceAllStringFunc(sql, func(m string) string { |
| 353 | return simpleStringsConversion[strings.ToLower(m)] |
no test coverage detected