uber-go / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
1.98k stars 107 forks source link

Create guides on migrating from golang/mock to go.uber.org/mock #5

Open sywhang opened 1 year ago

barrettj12 commented 1 year ago

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/mock@v0.2.0 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?

pavleprica commented 1 year ago

@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

bcho commented 1 year ago

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.