Open
Description
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)...
Activity