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:
- Move
ParseFactory and TestSuite to go.rtnl.ai/x so there are no tertiary dependencies
- Create a flag for generating the parser and the tests verbosely (perhaps using a template file rather than jen)
- 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.
Both the
ParseFactoryand theTestSuiteare defined ingo.rtnl.ai/enumifyand to simplify code generation, these objects are simply imported into the generated code and executed correctly.HOWEVER -- this causes
go.rtnl.ai/enumifyto 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:
ParseFactoryandTestSuitetogo.rtnl.ai/xso there are no tertiary dependenciesenumify_gen.gofile with theParseFactoryand TestSuite generic code to be used across all types in the packageNote 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.