Go Modules on Badger and Dgraph

I’d love to do that, but changing the import path would make it very hard for those not using Go Modules to depend on Badger.

And unfortunately, Dgraph depends on Badger and we’d rather not adopt Go Modules yet.

If you change Gopkg.toml on the v2.0.0 directory of github.com/campoy/badger-migrations, you will see that the version is not supported due to the change in import paths.

[prune]
  go-tests = true
  unused-packages = true

[[constraint]]
  name = "github.com/dgraph-io/badger"
  version = "=2.0.0-rc1"
$ dep ensure
...
        v2.0.0-rc1: "github.com/dgraph-io/badger" imports "github.com/dgraph-io/badger/v2/y", which contains malformed code: unknown error for "github.com/dgraph-io/badger/v2/y", if you get this error see https://github.com/golang/dep/issues/351
...

Of course, I tried using the right import path (github.com/dgraph-io/badger/v2) on Gopkg.toml but it didn’t work either:

The following issues were found in Gopkg.toml:

  ✗ the name for "github.com/dgraph-io/badger/v2" should be changed to "github.com/dgraph-io/badger"

I expect dep will fix this issue, eventually.
In the meantime, it seems our best option for us is not to support Go Modules.