Skip to content

Toolchain: go 1.27, latest dependencies, tidy, remove replace directives #10

Description

@TopherGopher

Part of the easymongo refactor (see PLAN.md on the refactor branch). Last code step, after the driver migration is complete.

Working context (read this first)

Scope

  • go 1.27 directive in go.mod.
  • Dependencies at their latest releases: go.mongodb.org/mongo-driver/v2 (2.9.x or newer), github.com/stretchr/testify, github.com/tophergopher/mongotest/v2 at its first tagged release. Remove go.mongodb.org/mongo-driver (v1), docker.io/go-docker, github.com/gogo/protobuf, github.com/sirupsen/logrus, github.com/tophergopher/mongotest (v1 path).
  • Delete both commented replace lines and any temporary replace ../mongotest/v2 used during development.
  • go mod tidy; gofmt -l . and go vet ./... clean.
  • Fix anything Go 1.27 vet flags (for example %w in Errorf inside the debug monitor at connect.go line 137 is passed to Errorf on the easymongo Logger, not fmt.Errorf, so it prints literally; switch to %v).
  • Replace interface{} with any where touched (not a global rewrite).

Implementation details

Commands, in order, from the repo root:

go mod edit -go=1.27
go mod edit -dropreplace=github.com/tophergopher/mongotest/v2   # if the temporary replace is present
go get github.com/tophergopher/mongotest/v2@<tagged version> go.mongodb.org/mongo-driver/v2@latest github.com/stretchr/testify@latest
go mod edit -droprequire=go.mongodb.org/mongo-driver -droprequire=github.com/tophergopher/mongotest -droprequire=docker.io/go-docker -droprequire=github.com/gogo/protobuf -droprequire=github.com/sirupsen/logrus
GOTOOLCHAIN=go1.27.1 go mod tidy
gofmt -l . ; go vet ./... ; go test -race ./...

Then delete the two commented // replace lines by hand (go mod edit does not remove comments).

Acceptance

  • go list -m all | wc -l is well below today's count (today's go.sum has 243 lines).
  • No replace directive in go.mod.
  • Full test suite green on Go 1.27.

Depends on: #2, #3, #4, #5, #6, #7, #8, #9 and the mongotest v2 module being tagged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions