-
Notifications
You must be signed in to change notification settings - Fork 891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GODRIVER-2690 Set minimum supported Go version to 1.18 in Go Driver v2.0 #1386
Conversation
@@ -41,7 +41,7 @@ func BenchmarkClientWrite(b *testing.B) { | |||
if err != nil { | |||
b.Fatalf("error connecting: %v", err) | |||
} | |||
defer client.Disconnect(context.Background()) | |||
defer func() { _ = client.Disconnect(context.Background()) }() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
golangci-lint wants us to check errors.
benchmark/bson.go
Outdated
@@ -11,7 +11,7 @@ import ( | |||
"io/ioutil" | |||
"path/filepath" | |||
|
|||
"go.mongodb.org/mongo-driver/bson" | |||
"go.mongodb.org/mongo-driver/v2/bson" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned that doing this package major version bump now is going to make keeping v1 and master in-sync difficult for the duration of v2 development. That may cause every v1 --> master sync to hit a merge conflict or require manual modification of the import path. Is it possible to defer making the module version change until later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this makes sense. I will revert those changes.
API Change ReportNo changes found! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Makefile
Outdated
.PHONY: check-modules | ||
check-modules: | ||
go mod tidy -v | ||
go mod vendor | ||
git diff --exit-code go.mod go.sum ./vendor | ||
go mod verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: go mod verify
seems to conflict with using Go workspaces in some cases (see golang/go#62663). When I run that command on my workstation, I get an error:
❯ go mod verify
go.mongodb.org/mongo-driver : missing ziphash: open hash: no such file or directory
Consider removing go mod verify
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
GODRIVER-2690
Summary
Migrate the Go imports and module to v2 and set minimum supported Go Version to 1.18. Additionally, updating to 1.18 allows us to remove the vendor directory.
Background & Motivation
The Go Driver team intends for the master branch to work as the "development" branch. Therefore, a "v1" branch has been cut where v1.x-focused tickets will be development on the "v1" branch and then cherry-picked , as needed, to the master branch.
This ticket updates the master branch to reflect the "development" branch as v2-focused.