cheekybits / genny

Elegant generics for Go
MIT License
1.71k stars 167 forks source link

Separate generated code in multiple files #41

Open icock opened 7 years ago

icock commented 7 years ago

Could genny offer a command line option to separate generated code in multiple files?

For example, "SomeType=string,int" will generate gen-source-string.go and gen-source-int.go.

meyerzinn commented 7 years ago

+1 definitely would be useful for me. Maybe another string interpolation for -out?

pdrum commented 6 years ago

@icock @20zinnm I think it would be usefule. Do you have some more specific ideas on how to get the parameters for what files to generate and where to put them?

duckbrain commented 3 years ago

One idea is expand of the generic name replacement.

eg: -out gen-source-Something.go Something=string,int Other=bool,float64 creates gen-source-string.go and gen-source-int.go where the Other variations are copied in each of the files, but the Something ones are distinct to their output files.