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

Unify godoc / description? #8

Open
justinbastress opened this issue Jun 29, 2018 · 0 comments
Open

Unify godoc / description? #8

justinbastress opened this issue Jun 29, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@justinbastress
Copy link
Contributor

In practice, I often end up with code like this:

type Flags struct {
  // Flag1 does whatever flag1 does
  Flag1 string `long:"flag1" description:"Does whatever flag1 does"`
  // Flag2 does whatever flag2 does
  Flag2 string `long:"flag2" description:"Does whatever flag2 does"`
  // ...etc
}

where the field godocs are basically identical to the description, which opens us up to all the problems of code duplication (easy to get out of sync etc).

One solution would be code generation; another might be to have the description field read from the field's godoc when absent (assumes that source is available)...

@justinbastress justinbastress added the enhancement New feature or request label Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant