Merge pull request #5938 from thaJeztah/man_cleans

man: fix minor linting issues
This commit is contained in:
Sebastiaan van Stijn 2025-03-19 12:49:12 +01:00 committed by GitHub
commit 0f75059e9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,6 @@
// This file is intended for use with "go run"; it isn't really part of the package.
//go:build manpages
// +build manpages
package main
@ -63,8 +62,8 @@ func generateManPages(opts *options) error {
})
}
func loadLongDescription(cmd *cobra.Command, path string) error {
for _, cmd := range cmd.Commands() {
func loadLongDescription(parentCommand *cobra.Command, path string) error {
for _, cmd := range parentCommand.Commands() {
cmd.DisableFlagsInUseLine = true
if cmd.Name() == "" {
continue
@ -72,7 +71,9 @@ func loadLongDescription(cmd *cobra.Command, path string) error {
fullpath := filepath.Join(path, cmd.Name()+".md")
if cmd.HasSubCommands() {
loadLongDescription(cmd, filepath.Join(path, cmd.Name()))
if err := loadLongDescription(cmd, filepath.Join(path, cmd.Name())); err != nil {
return err
}
}
if _, err := os.Stat(fullpath); err != nil {

View File

@ -1,5 +1,4 @@
//go:build tools
// +build tools
package main