fix: func name in doc strings (#1885)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Corrected the function name at the start of doc strings, as per the convention outlined in official go documentation: https://go.dev/blog/godoc
authored by Yash Ladha · committed by GitHub · parent fdffa5a · Browse files · 5 files·+10 added−10 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+10 added−10 removed
- other:+10 added−10 removed
Provenance
- Commit
bf11ab6- Tree
6663cf8- Author
Yash Ladha <18033231+yashLadha@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
fdffa5a
5 files changed+10 added−10 removed
modified:doc/rest_docs.go+2 added-2 removed
46 unmodified lines47 }48 return nil49 }50 51-// linkHandler for default ReST hyperlink markup51+// defaultLinkHandler for default ReST hyperlink markup52 func defaultLinkHandler(name, ref string) string {53 return fmt.Sprintf("`%s <%s.rst>`_", name, ref)54 }55 112 unmodified lines168 }169 return nil170 }171 172-// adapted from: https://github.com/kr/text/blob/main/indent.go172+// indentString adapted from: https://github.com/kr/text/blob/main/indent.go173 func indentString(s, p string) string {174 var res []byte175 b := []byte(s)176 prefix := []byte(p)10 unmodified linesmodified:args.go+1 added-1 removed
19 unmodified lines20 )21 22 type PositionalArgs func(cmd *Command, args []string) error23 24-// Legacy arg validation has the following behaviour:24+// legacyArgs validation has the following behaviour:25 // - root commands with no subcommands can take arbitrary arguments26 // - root commands with subcommands will do subcommand validity checking27 // - subcommands will always accept arbitrary arguments28 func legacyArgs(cmd *Command, args []string) error {103 unmodified linesmodified:bash_completions.go+1 added-1 removed
530 unmodified lines531 WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand))532 }533 }534 535-// Setup annotations for go completions for registered flags535+// prepareCustomAnnotationsForFlags setup annotations for go completions for registered flags536 func prepareCustomAnnotationsForFlags(cmd *Command) {537 flagCompletionMutex.RLock()538 defer flagCompletionMutex.RUnlock()539 for flag := range flagCompletionFunctions {173 unmodified linesmodified:command.go+5 added-5 removed
33 unmodified lines34 35 // FParseErrWhitelist configures Flag parse errors to be ignored36 type FParseErrWhitelist flag.ParseErrorsWhitelist37 38-// Structure to manage groups for commands38+// Group Structure to manage groups for commands39 type Group struct {40 ID string41 Title string42 }3 unmodified lines46 // you to define the usage and description as part of your command47 // definition to ensure usability.48 type Command struct {49 // Use is the one-line usage message.50- // Recommended syntax is as follow:50+ // Recommended syntax is as follows:51 // [ ] identifies an optional argument. Arguments that are not enclosed in brackets are required.52 // ... indicates that you can specify multiple values for the previous argument.53 // | indicates mutually exclusive information. You can use the argument to the left of the separator or the54 // argument to the right of the separator. You cannot use both arguments in a single use of the command.265 unmodified lines320 func (c *Command) SetHelpCommand(cmd *Command) {321 c.helpCommand = cmd322 }323 324-// SetHelpCommandGroup sets the group id of the help command.324+// SetHelpCommandGroupID sets the group id of the help command.325 func (c *Command) SetHelpCommandGroupID(groupID string) {326 if c.helpCommand != nil {327 c.helpCommand.GroupID = groupID328 }329 // helpCommandGroupID is used if no helpCommand is defined by the user330 c.helpCommandGroupID = groupID331 }332 333-// SetCompletionCommandGroup sets the group id of the completion command.333+// SetCompletionCommandGroupID sets the group id of the completion command.334 func (c *Command) SetCompletionCommandGroupID(groupID string) {335 // completionCommandGroupID is used if no completion command is defined by the user336 c.Root().completionCommandGroupID = groupID337 }957 unmodified lines1295 }1296 return true1297 }1298 1299-// ContainGroups return if groupID exists in the list of command groups.1299+// ContainsGroup return if groupID exists in the list of command groups.1300 func (c *Command) ContainsGroup(groupID string) bool {1301 for _, x := range c.commandgroups {1302 if x.ID == groupID {1303 return true531 unmodified linesmodified:completions.go+1 added-1 removed
167 unmodified lines168 }169 return strings.Join(directives, ", ")170 }171 172-// Adds a special hidden command that can be used to request custom completions.172+// initCompleteCmd adds a special hidden command that can be used to request custom completions.173 func (c *Command) initCompleteCmd(args []string) {174 completeCmd := &Command{175 Use: fmt.Sprintf("%s [command-line]", ShellCompRequestCmd),176 Aliases: []string{ShellCompNoDescRequestCmd},695 unmodified lines