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
The "go.mongodb.org/mongo-driver" and "github.com/mongodb/mongo-go-driver" are the same repos. This will work in isolation, bring about potential risks and problems.
So, why not get rid of the old import path "github.com/mongodb/mongo-go-driver", use "go.mongodb.org/mongo-driver" instead.
To get started with the driver, import the mongo package, create a mongo.Client:
import (
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
…
Background
I find that
go.mongodb.org/mongo-driver
andgithub.com/mongodb/mongo-go-driver
coexist in this repo:https://github.com/tetrateio/training/blob/master/samples/modernbank/microservices/user/go.mod (Line 16 & 22)
https://github.com/tetrateio/training/blob/master/samples/modernbank/microservices/transaction-log/go.mod (Line 18 & 23)
The
mongodb/mongo-go-driver
has already renamed it’s import path from "github.com/mongodb/mongo-go-driver" to "go.mongodb.org/mongo-driver".https://github.com/mongodb/mongo-go-driver/blob/v1.0.0/mongo/client.go#L16
The "go.mongodb.org/mongo-driver" and "github.com/mongodb/mongo-go-driver" are the same repos. This will work in isolation, bring about potential risks and problems.
So, why not get rid of the old import path "github.com/mongodb/mongo-go-driver", use "go.mongodb.org/mongo-driver" instead.
Solution
Follow the requirements of mongodb/mongo-go-driver README.md:
Replace all the old import paths, change
"github.com/mongodb/mongo-go-driver"
to"go.mongodb.org/mongo-driver"
.Where did you import it: https://github.com/tetrateio/training/search?l=Text&q=github.com%2Fmongodb%2Fmongo-go-driver
The text was updated successfully, but these errors were encountered: