Skip to content

Unify godoc / description? #8

Open
@justinbastress

Description

@justinbastress

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions