ernesto-jimenez / gogen

A set of go packages and command line tools to generate Go code
MIT License
95 stars 14 forks source link

imports: fix vendored import paths #2

Closed toxeus closed 8 years ago

toxeus commented 8 years ago

Before, vendored import paths would not be devendorized for mocks generated using goautomock. This would fail compilation for the generated code because vendored import paths are not allowed to be used in Go's import statements.

Now, the import paths are correctly devendorized by using vendorlessImportPath() that was shamelessly copied form https://github.com/golang/tools/blob/5cb1c80a83ef2a98bbc7b2fba1305239bb684fbe/imports/fix.go#L579-L590

ernesto-jimenez commented 8 years ago

Build failed because there is some problem with the travis config. But the code works OK.

Merging, thanks!