You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)...
The text was updated successfully, but these errors were encountered:
In practice, I often end up with code like this:
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)...The text was updated successfully, but these errors were encountered: