Skip to content
Myr

Fix linter errors (#2052)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

When using golangci-lint v1.55.0 some new errors were being reported.

authored by Marc Khouzam · committed by GitHub · parent 4cafa37 · Browse files · 2 files+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>

Diff stats

2 files+6 added−3 removed

  • other:+6 added−3 removed

2 files+6 added−3 removed

modified:doc/md_docs.go+5 added-3 removed
25 unmodified lines
2627 "github.com/spf13/cobra"28)2930const markdownExtension = ".md"3132func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error {33 flags := cmd.NonInheritedFlags()34 flags.SetOutput(buf)35 if flags.HasAvailableFlags() {
48 unmodified lines
84 buf.WriteString("### SEE ALSO\n\n")85 if cmd.HasParent() {86 parent := cmd.Parent()87 pname := parent.CommandPath()86 link := pname + ".md"88 link := pname + markdownExtension89 link = strings.ReplaceAll(link, " ", "_")90 buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", pname, linkHandler(link), parent.Short))91 cmd.VisitParents(func(c *cobra.Command) {92 if c.DisableAutoGenTag {
9 unmodified lines
102 if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {103 continue104 }105 cname := name + " " + child.Name()104 link := cname + ".md"106 link := cname + markdownExtension107 link = strings.ReplaceAll(link, " ", "_")108 buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", cname, linkHandler(link), child.Short))109 }110 buf.WriteString("\n")
28 unmodified lines
139 return err140 }141 }142141 basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".md"143 basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + markdownExtension144 filename := filepath.Join(dir, basename)145 f, err := os.Create(filename)146 if err != nil {147 return err
11 unmodified lines
modified:command.go+1 added
1444 unmodified lines
1445}14461447// DebugFlags used to determine which flags have been assigned to which commands1448// and which persist.1449// nolint:goconst1450func (c *Command) DebugFlags() {1451 c.Println("DebugFlags called on", c.Name())1452 var debugflags func(*Command)1453
426 unmodified lines