Skip to content

Generated code imports enumify #7

@bbengfort

Description

@bbengfort

Both the ParseFactory and the TestSuite are defined in go.rtnl.ai/enumify and to simplify code generation, these objects are simply imported into the generated code and executed correctly.

HOWEVER -- this causes go.rtnl.ai/enumify to be a dependency of the generated code package, which isn't a big deal, except that its tertiary dependencies also get added to the generated code package.

To fix this we should do one ore more of the following:

  1. Move ParseFactory and TestSuite to go.rtnl.ai/x so there are no tertiary dependencies
  2. Create a flag for generating the parser and the tests verbosely (perhaps using a template file rather than jen)
  3. Add an enumify_gen.go file with the ParseFactory and TestSuite generic code to be used across all types in the package

Note that #2 is best for packages that only have 1 enum and #3 is best for packages that have multiple neums. #1 is by far the simplest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions