strings.Replace(cmd.CommandPath(), " ", "_", -1)
168 }
169 }
170
171 basename := strings.Replace(cmd.CommandPath(), " ", "_", -1) + ".md"172 filename := filepath.Join(dir, basename)
173 f, err := os.Create(filename)
174 if err != nil {
strings.Replace(link, " ", "_", -1)
126 parent := cmd.Parent()
127 pname := parent.CommandPath()
128 link := pname + ".md"
129 link = strings.Replace(link, " ", "_", -1)130 buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", pname, linkHandler(link), parent.Short))
131 cmd.VisitParents(func(c *cobra.Command) {
132 if c.DisableAutoGenTag {
strings.Replace(link, " ", "_", -1)
106 }
107 cname := name + " " + child.Name()
108 link := cname + ".md"
109 link = strings.Replace(link, " ", "_", -1)110 buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", child.Name(), linkHandler(link), child.Short))
111 }
112 buf.WriteString("\n")
strings.Replace(strings.Join(keys, " "), "_", " ", -1)
86 }
87 }
88 obj[0] = append(obj[0], value)
89 colName := strings.Title(strings.Replace(strings.Join(keys, " "), "_", " ", -1)) 90 cols = append(cols, colName)
91 }
92
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")