Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unneeded error from printOption method #1549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YikSanChan
Copy link

@YikSanChan YikSanChan commented Dec 2, 2021

The code below doesn't really need the error as return type, so I remove it

func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error {
	flags := cmd.NonInheritedFlags()
	flags.SetOutput(buf)
	if flags.HasAvailableFlags() {
		parentFlags.PrintDefaults()
		buf.WriteString("```\n\n")
	}
	return nil
}

@CLAassistant
Copy link

CLAassistant commented Dec 2, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/docs-generation Generation of docs via Cobra label Dec 2, 2021
@YikSanChan
Copy link
Author

@jpmcb Hi John, do you mind taking a quick look at this PR? Should be a fairly straightforward fix :) Thanks!

@jpmcb
Copy link
Collaborator

jpmcb commented Dec 20, 2021

Can you add a description to this PR please? Thanks much!!

@YikSanChan
Copy link
Author

@jpmcb Added. Thanks!

@github-actions
Copy link

This PR is being marked as stale due to a long period of inactivity

@jpmcb
Copy link
Collaborator

jpmcb commented Mar 26, 2022

we probably still want this - reopening and marking myself as reviewer

@jpmcb jpmcb reopened this Mar 26, 2022
@jpmcb jpmcb self-requested a review March 26, 2022 15:49
hoshsadiq pushed a commit to zulucmd/zulu that referenced this pull request Dec 31, 2022
The code below doesn't really need the `error` as return type, so I remove it

```go
func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error {
	flags := cmd.NonInheritedFlags()
	flags.SetOutput(buf)
	if flags.HasAvailableFlags() {
		parentFlags.PrintDefaults()
		buf.WriteString("```\n\n")
	}
	return nil
}
```

Merge spf13/cobra#1549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs-generation Generation of docs via Cobra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants