package util import ( "strconv" "strings" ) func ReplaceSQL(old, searchPattern string) string { tmpCount := strings.Count(old, searchPattern) for m := 1; m <= tmpCount; m++ { old = strings.Replace(old, searchPattern, "$"+strconv.Itoa(m), 1) } return old }