strings.Replace(utils.ToStr(arg),
%,
\%, -1)
1482 params[0] = "IS NULL"
1483 }
1484 case "iexact", "contains", "icontains", "startswith", "endswith", "istartswith", "iendswith":
1485 param := strings.Replace(utils.ToStr(arg), `%`, `\%`, -1)1486 switch operator {
1487 case "iexact":
1488 case "contains", "icontains":
strings.Replace(column, "%COL%", fi.Column, -1)
100 }
101
102 if strings.Contains(column, "%COL%") {
103 column = strings.Replace(column, "%COL%", fi.Column, -1)104 }
105
106 if fi.Description != "" && al.Driver != DRSqlite {
strings.Replace(comment, lineBreak, lineBreak+prefix, -1)
371 }
372 prefix := string(bNumComment)
373 // Add the line head character "#"
374 return prefix + strings.Replace(comment, lineBreak, lineBreak+prefix, -1)375 }
376 return ""
377 }
strings.Replace(url, urlPlaceholder, p+"."+e, -1)
922 if e, isok := params[":ext"]; isok {
923 delete(params, ":path")
924 delete(params, ":ext")
925 return true, strings.Replace(url, urlPlaceholder, p+"."+e, -1) + toURL(params) 926 }
927 }
928 }
strings.Replace(name, "\\", "/", -1)
289}
290
291func _filePath(dir, name string) string {
292 cannonicalName := strings.Replace(name, "\\", "/", -1)293 return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
294}
295
Certain functions, for a particular set of arguments, have shorthands (helpers) that can be used instead.
We currently support Autofix for, Format: x => y where "x" is recommended to be replaced with "y" helper function.
Supported Autofix for the following: strings.SplitN(s, ".", -1) => strings.Split(s, ".") strings.Map(unicode.ToTitle, s) => strings.ToTitle(s) strings.Replace(s, "a", "b", -1) => strings.ReplaceAll(s, "a", "b") bytes.SplitN(b, []byte("."), -1) => bytes.Split(b, []byte(".")) bytes.Map(unicode.ToUpper, b) => bytes.ToUpper(b) bytes.Map(unicode.ToLower, b) => bytes.ToLower(b) bytes.Map(unicode.ToTitle, b) => bytes.ToTitle(b) bytes.Replace(b, b, b, -1) => bytes.ReplaceAll(b, b, b) http.HandlerFunc(http.NotFound) => http.NotFoundHandler() draw.DrawMask(i, r, i, p, nil, image.Point{}, o) => draw.Draw(i, r, i, p, o)
wg.Add(1)
// some code
wg.Add(-1)
wg.Add(1)
// some code
wg.Done()
strings.SplitN(str, splitChar, -1)
strings.Split(str, splitChar)
http.HandlerFunc("/non-existent", http404)
http.NotFoundHandler("/non-existent")