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
I have a project which uses go generics. I am moving to uber go mockgen to use mocks with generics types.
I installed mockgen using following
go install go.uber.org/mock/mockgen@latest
I regenerated all my mocks for current project using go generate ./.... I can see mocks has following gomock in import
gomock"go.uber.org/mock/gomock"
Problem: I have other dependencies (a common lib project - let's call it X) having old gomock dependencies. For convenience that dependency (X) also generates mocks we use it in the projects
Now I have tests in my project which use these mocks from lib dependency (X). Now I am getting issues because my current test are using mocks from my projects (which use uber gomock.NewController()) and the lib mocks use old gomock.NewController()
Any idea how to solve this issue. I tried replace in go.mod as well but it did not help
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a project which uses go generics. I am moving to uber go mockgen to use mocks with generics types.
Problem: I have other dependencies (a common lib project - let's call it X) having old gomock dependencies. For convenience that dependency (X) also generates mocks we use it in the projects
Now I have tests in my project which use these mocks from lib dependency (X). Now I am getting issues because my current test are using mocks from my projects (which use uber gomock.NewController()) and the lib mocks use old gomock.NewController()
Any idea how to solve this issue. I tried replace in go.mod as well but it did not help
Beta Was this translation helpful? Give feedback.
All reactions