The idea is that everyone who uses v2 should import it as "github.com/dgraph-io/badger/v2". Not just modules users.
Here’s how I’d release v2 of badger=:
- Make a directory in the
badgerrepo calledv2. - Put the
v2badger packages inside thev2directory, and update their import paths to begin with"github.com/dgraph-io/badger/v2" - Put a go.mod file in the
v2directory with the declarationmodule github.com/dgraph-io/badger/v2. - Commit all of that, and tag it with
v2.0.0.
Then users of badger v2, whether they us modules or not, should import it with the v2 import path. That should work for everyone, right?