go-zero
go-zero copied to clipboard
update:github.com/mongodb/mongo-go-driver v2.0 Migration
github.com/mongodb/mongo-go-driver v2.0 Migration
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:loudspeaker: Thoughts on this report? Let us know!
Hi @kevwan I have finished, go-mongodb-driver v2 version of the migration, can you please help me to review the code,thanks!
Since github.com/golang/mock is no longer maintained, I got an error generating functions with generic signatures, and then the official recommendation was to use go.uber.org/mock, which is still maintained, so I used it.
It's a bit unfortunate that go.uber.org/mock requires a minimum of go1.22, do we need to upgrade it? go is now up to go1.24.1 with the latest version!
@me-cs Would you please just update the mon/monc package?
@me-cs Would you please just update the mon/monc package?
@kevwan Got it! Just to confirm:
- You want me to update ONLY the
mon/moncpackages - Without performing a full
go mod tidythat would update all dependencies in go.mod/go.sum?
I mean we don't need mon/v2, just change mon to use v2 instead.
I mean we don't need mon/v2, just change mon to use v2 instead.
@kevwan That would be a breaking change.
It's a bit unfortunate that go.uber.org/mock requires a minimum of go1.22, do we need to upgrade it? go is now up to go1.24.1 with the latest version!
no need to use go.uber.org/mock, we can use github.com/golang/mock instead.
I mean we don't need mon/v2, just change mon to use v2 instead.
@kevwan That would be a breaking change.
I think we can write the detailed migration guide in mon/monc packages. But I don't want to keep both versioins, that will bring more maintainence work.
Also, we can put the original version in zero-contrib repo for legency use.
zero-contrib
I mean we don't need mon/v2, just change mon to use v2 instead.
@kevwan That would be a breaking change.
I think we can write the detailed migration guide in mon/monc packages. But I don't want to keep both versioins, that will bring more maintainence work.
Also, we can put the original version in zero-contrib repo for legency use.
Okay, I'll proceed with this plan.
It's a bit unfortunate that go.uber.org/mock requires a minimum of go1.22, do we need to upgrade it? go is now up to go1.24.1 with the latest version!
no need to use
go.uber.org/mock, we can usegithub.com/golang/mockinstead.
@kevwan Since github.com/golang/mock is no longer maintained, I got an error generating functions with generic signatures, and then the official recommendation was to use go.uber.org/mock, which is still maintained, so I used it.
you can see this issues here https://github.com/golang/mock/issues/700
@kevwan All done, I'm ready for the code review.
I'll review it this weekend, thanks!
Would you please rebase and change go.mod to 1.21?
Would you please rebase and change go.mod to 1.21?
I've completed the rebase and updated the go.mod file to use Go 1.21. Apologies for the delay in getting this done—thanks for your patience! @kevwan