cheekybits / genny

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

Reflect removed from generated code #37

Open itsmontoya opened 7 years ago

itsmontoya commented 7 years ago

When generating a file which utilizes reflect, I noticed that reflect gets strips out of my import list. Generated file Source file

itsmontoya commented 7 years ago

So it looks as though the imports library (stdlib) is not inserting reflect during it's fixImport func. That's very strange..

itsmontoya commented 7 years ago

I got around this by creating a separate utilities library where code generation wasn't touching. It's a lame work-around, but it looks like it's out of our control right now.

I'm going to leave this open because I'd like to get your thoughts on this situation.

pdrum commented 6 years ago

@itsmontoya One of the links are broken and I'm not sure whether the other one is still the same as the time you wrote the post. So I can not check what exactly has gone wrong. Do you mean you had imported reflect in your source and genny has not included it in the generated code?