go-thrift icon indicating copy to clipboard operation
go-thrift copied to clipboard

generator: separate packages from imports

Open samuel opened this issue 12 years ago • 1 comments

Right now the generator can only create a single Go file which includes all imports. It would be good to be able to create separate packages from the imports instead of bundling. This would allow for multiple uses of the imports, and it would fix some import namespace issues.

samuel avatar May 22 '13 00:05 samuel

When includes are involved there are likely multiple thrift interfaces sharing the include, if you generated the include package automatically you may end up generating it twice. Would it be easier to have the generator look at the include but not automatically generate, or even have a command line option to toggle this behavior. For my particular use case it is easier to call generate on each .thrift file without worrying about side effects on each generation. Another option could be just supporting multiple input files to the generator, then you could just run command like ./generator *.thrift -outputdir src.

dmcgowan avatar May 22 '13 01:05 dmcgowan