-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Refactor the user guide to avoid to use the init()
func
#1862
Comments
Absolutely; as the other issues make clear we are on board with those kind of changes. My only comment would be to try and make it so that those changes (boilerplate, docs, etc) all change in a similar fashion to avoid confusion. If you want to try and tackle multiple parts of that then even better. |
The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:
|
nope |
Just want to add this is kind of tangentially related to documenting or changing the default templates to setup unit testing correctly: #770 I'm new to cobra and I am trying the approach of wrapping the command in a function (common approach), but the template includes I assumed
|
Not sure if useful but I avoided mostly Still some stuff to cleanup (quick side project), so maybe that can get you started until someone else provides more detail. |
The user guide is linked from the main README, and I guess it's where most of the people will just land for a quick copy-paste.
The guide is showing how to setup a command with the
init()
func, but I think it's a bad approach (and also looking for related issues I'm not the only one):One of the main problem of this is that is not possible to handle any errors, so I would like to know if it was feasible to at least update the user guide to show a more idiomatic approach (i.e. the
BindPFlag
func err is ignored, and theerrcheck
linter complains about it).Are you willing to accept a PR on a different style? 🙂
The text was updated successfully, but these errors were encountered: