You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior A clear and concise description of what you expected to
happen.
This is because in our code base (or similar code base created before go mod area) contains import path like this:
_ "github.com/golang/mock/mockgen/model"
This call will register the model types with the same name, and result in gob panic. This import call is suggested by golang mockgen as a workaround for vendor usage:
I believe this would be a blocker for migrating from golang mockgen as upstream libraries might have such import path, and it would take time to migrate all these upstream libraries as it requires multiple steps.
Therefore, I would like to propose a fix to register these model types with a prefix.
Actual behavior A clear and concise description of what the bug is.
When running this uber mockgen in a codebase with reference to the golang mockgen, the reflect program would panic on the
gob.Register
call:Expected behavior A clear and concise description of what you expected to
happen.
This is because in our code base (or similar code base created before go mod area) contains import path like this:
This call will register the model types with the same name, and result in gob panic. This import call is suggested by golang mockgen as a workaround for vendor usage:
https://github.com/golang/mock#reflect-vendoring-error
I believe this would be a blocker for migrating from golang mockgen as upstream libraries might have such import path, and it would take time to migrate all these upstream libraries as it requires multiple steps.
Therefore, I would like to propose a fix to register these model types with a prefix.
To Reproduce Steps to reproduce the behavior
To produce this issue, please check out this commit: https://github.com/bcho/gomock-migrate/tree/4148048b8a313fa0be6164d1cdcdc941e523c0c1
I have a fix poc in this commit: https://github.com/bcho/gomock-migrate/tree/2de73982ee899e4e0a3986a021b584c08feb3e5f , which updated the uber gomock to use the fixed model in my local fork.
Additional Information
0.2.0
Triage Notes for the Maintainers
The text was updated successfully, but these errors were encountered: