whyrusleeping / cbor-gen

Codegen for cbor codecs on your types
MIT License
35 stars 25 forks source link

WriteTupleEncodersToFile generates uncompilable file given no types #45

Open anorth opened 4 years ago

anorth commented 4 years ago

If the types argument is empty, the resulting file imports io, fmt etc but doesn't use them, and so doesn't compile.

This can be worked around at the caller side, but it would be easier if this case were handled naturally by avoiding those imports if not needed.