mock
mock copied to clipboard
Create guides on migrating from golang/mock to go.uber.org/mock
I, for one, would really appreciate this. I tried using a replace directive in go.mod:
replace github.com/golang/mock => go.uber.org/mock v0.2.0
but it didn't work:
$ go mod tidy
...
go: go.uber.org/[email protected] used for two different module paths (github.com/golang/mock and go.uber.org/mock)
Is there an easy way, or do I simply have to change the import path in every Go file?
@barrettj12 it is a bit weird when switching because of the present github.com/golang/mock dependency. But Find+Replace with github.com/golang/mock -> go.uber.org/mock/gomock and mod tidy-ing should do the job
I believe this https://github.com/uber-go/mock/issues/51 issue would also block the migration as it might conflict with upstream package's import.