strings.Replace(str, "\x1b", "", -1)
846}
847
848func cleanse(str string) string {
849 return strings.Replace(str, "\x1b", "", -1)850}
851
852func (w *LightWindow) CPrint(pair ColorPair, attr Attr, text string) {
strings.Replace(entry, "'", "'\\''", -1)
1213 if util.IsWindows() {
1214 return quoteEntryCmd(entry)
1215 }
1216 return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'"1217}
1218
1219func parsePlaceholder(match string) (bool, string, placeholderFlags) {
strings.Replace(escaped,
",
\", -1)
1202
1203func quoteEntryCmd(entry string) string {
1204 escaped := strings.Replace(entry, `\`, `\\`, -1)
1205 escaped = `"` + strings.Replace(escaped, `"`, `\"`, -1) + `"`1206 r, _ := regexp.Compile(`[&|<>()@^%!"]`)
1207 return r.ReplaceAllStringFunc(escaped, func(match string) string {
1208 return "^" + match
strings.Replace(entry,
\,
\\, -1)
1201}
1202
1203func quoteEntryCmd(entry string) string {
1204 escaped := strings.Replace(entry, `\`, `\\`, -1)1205 escaped = `"` + strings.Replace(escaped, `"`, `\"`, -1) + `"`
1206 r, _ := regexp.Compile(`[&|<>()@^%!"]`)
1207 return r.ReplaceAllStringFunc(escaped, func(match string) string {
strings.Replace(query, "\t", " ", -1)
315}
316
317func trimQuery(query string) []rune {
318 return []rune(strings.Replace(query, "\t", " ", -1)) 319}
320
321// NewTerminal returns new Terminal object
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")