go version)?go 1.12
v1.5.5, v2.0
main.go
package main
import (
"github.com/dgraph-io/badger"
)
type A struct {
db *badger.DB
}
func main() {
}
go.mod
module app3
go 1.12
require (
github.com/dgraph-io/badger v2.0
)
app3 should be built successfully
go: finding github.com/dgryski/go-farm latest
go: finding github.com/AndreasBriese/bbloom latest
go: extracting github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b
go: extracting github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96
build app3: cannot load github.com/AndreasBriese/bbloom: cannot find module providing package github.com/AndreasBriese/bbloom
Have you tried putting v2.0.0 instead of v2.0 in your go.mod file and changing the import path to github.com/dgraph-io/badger/v2?
@hikingpig Please try using github.com/dgraph-io/badger/v2 as the import path.