package shared import "strings" // LikePattern escapes SQL LIKE metacharacters and wraps term for a %term% match. func LikePattern(term string) string { term = strings.ReplaceAll(term, `\`, `\\`) term = strings.ReplaceAll(term, `%`, `\%`) term = strings.ReplaceAll(term, `_`, `\_`) return "%" + term + "%" }