diff --git a/.travis.yml b/.travis.yml index d123ae443..7c58e56d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: go go: - - "1.10" - "1.11" - "1.12" diff --git a/README.md b/README.md index 873316025..92132c742 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,10 @@ few months. The [Changelog] is kept fairly up-to-date. ## Getting Started ### Installing -To start using Badger, install Go 1.8 or above and run `go get`: +To start using Badger, install Go 1.11 or above and run `go get`: ```sh -$ go get github.com/dgraph-io/badger/... +$ go get github.com/dgraph-io/badger/v2/... ``` This will retrieve the library and install the `badger` command line @@ -76,7 +76,7 @@ package main import ( "log" - "github.com/dgraph-io/badger" + badger "github.com/dgraph-io/badger/v2" ) func main() { diff --git a/appveyor.yml b/appveyor.yml index 79dac338e..395c1a2f7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,7 @@ clone_folder: c:\gopath\src\github.com\dgraph-io\badger environment: GOVERSION: 1.8.3 GOPATH: c:\gopath + GO111MODULE: on # scripts that run after cloning repository install: @@ -33,8 +34,8 @@ build_script: test_script: # Unit tests - ps: Add-AppveyorTest "Unit Tests" -Outcome Running - - go test -v github.com/dgraph-io/badger/... - - go test -v -vlog_mmap=false github.com/dgraph-io/badger/... + - go test -v github.com/dgraph-io/badger/v2/... + - go test -v -vlog_mmap=false github.com/dgraph-io/badger/v2/... - ps: Update-AppveyorTest "Unit Tests" -Outcome Passed notifications: diff --git a/backup.go b/backup.go index 31548a71f..f6536d8c7 100644 --- a/backup.go +++ b/backup.go @@ -23,8 +23,8 @@ import ( "encoding/binary" "io" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" ) // Backup is a wrapper function over Stream.Backup to generate full and incremental backups of the diff --git a/backup_test.go b/backup_test.go index ef3e6f53f..2c4115721 100644 --- a/backup_test.go +++ b/backup_test.go @@ -28,7 +28,7 @@ import ( "testing" "time" - "github.com/dgraph-io/badger/pb" + "github.com/dgraph-io/badger/v2/pb" "github.com/stretchr/testify/require" ) diff --git a/badger/cmd/backup.go b/badger/cmd/backup.go index 63e75e005..72d22aa36 100644 --- a/badger/cmd/backup.go +++ b/badger/cmd/backup.go @@ -20,8 +20,8 @@ import ( "bufio" "os" - "github.com/dgraph-io/badger" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2" + "github.com/dgraph-io/badger/v2/y" "github.com/spf13/cobra" ) diff --git a/badger/cmd/bank.go b/badger/cmd/bank.go index b5b794e3c..f866e4d84 100644 --- a/badger/cmd/bank.go +++ b/badger/cmd/bank.go @@ -30,10 +30,10 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" "github.com/spf13/cobra" ) diff --git a/badger/cmd/flatten.go b/badger/cmd/flatten.go index 653d1d37f..4d58bccae 100644 --- a/badger/cmd/flatten.go +++ b/badger/cmd/flatten.go @@ -17,7 +17,7 @@ package cmd import ( - "github.com/dgraph-io/badger" + "github.com/dgraph-io/badger/v2" "github.com/spf13/cobra" ) diff --git a/badger/cmd/info.go b/badger/cmd/info.go index 824262db4..da57851d6 100644 --- a/badger/cmd/info.go +++ b/badger/cmd/info.go @@ -29,10 +29,10 @@ import ( "github.com/pkg/errors" - "github.com/dgraph-io/badger" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" humanize "github.com/dustin/go-humanize" "github.com/spf13/cobra" ) diff --git a/badger/cmd/read_bench.go b/badger/cmd/read_bench.go index 5a7b34dc5..b2821bd1e 100644 --- a/badger/cmd/read_bench.go +++ b/badger/cmd/read_bench.go @@ -27,10 +27,10 @@ import ( humanize "github.com/dustin/go-humanize" "github.com/spf13/cobra" - "github.com/dgraph-io/badger" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" ) var readBenchCmd = &cobra.Command{ diff --git a/badger/cmd/restore.go b/badger/cmd/restore.go index c524bd3ae..8efa7f3e3 100644 --- a/badger/cmd/restore.go +++ b/badger/cmd/restore.go @@ -21,7 +21,7 @@ import ( "os" "path" - "github.com/dgraph-io/badger" + "github.com/dgraph-io/badger/v2" "github.com/spf13/cobra" ) diff --git a/badger/cmd/write_bench.go b/badger/cmd/write_bench.go index 4cf668ca8..746e7d34c 100644 --- a/badger/cmd/write_bench.go +++ b/badger/cmd/write_bench.go @@ -28,9 +28,9 @@ import ( humanize "github.com/dustin/go-humanize" "github.com/spf13/cobra" - "github.com/dgraph-io/badger" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" ) var writeBenchCmd = &cobra.Command{ diff --git a/badger/main.go b/badger/main.go index e03affc24..7542f1e17 100644 --- a/badger/main.go +++ b/badger/main.go @@ -22,7 +22,7 @@ import ( _ "net/http/pprof" "runtime" - "github.com/dgraph-io/badger/badger/cmd" + "github.com/dgraph-io/badger/v2/badger/cmd" ) func main() { diff --git a/batch.go b/batch.go index c94e0fed4..abeee15f6 100644 --- a/batch.go +++ b/batch.go @@ -19,7 +19,7 @@ package badger import ( "sync" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) // WriteBatch holds the necessary info to perform batched writes. diff --git a/compaction.go b/compaction.go index 931d56664..ff01b8e89 100644 --- a/compaction.go +++ b/compaction.go @@ -25,8 +25,8 @@ import ( "golang.org/x/net/trace" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" ) type keyRange struct { diff --git a/db.go b/db.go index 67c8c0473..2c95a91fc 100644 --- a/db.go +++ b/db.go @@ -32,11 +32,11 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/skl" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/skl" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" humanize "github.com/dustin/go-humanize" "github.com/pkg/errors" "golang.org/x/net/trace" diff --git a/db_test.go b/db_test.go index 05604be4e..3d0c9675c 100644 --- a/db_test.go +++ b/db_test.go @@ -35,11 +35,11 @@ import ( "testing" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/skl" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/skl" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) diff --git a/go.mod b/go.mod index 9a67479a8..0a3d14bb8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/dgraph-io/badger +module github.com/dgraph-io/badger/v2 require ( github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7 diff --git a/integration/testgc/main.go b/integration/testgc/main.go index f605c27ee..5fc4809cd 100644 --- a/integration/testgc/main.go +++ b/integration/testgc/main.go @@ -12,9 +12,9 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" ) var maxValue int64 = 10000000 diff --git a/iterator.go b/iterator.go index f4af4058d..686bb7ea3 100644 --- a/iterator.go +++ b/iterator.go @@ -24,10 +24,10 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/table" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) type prefetchStatus uint8 diff --git a/iterator_test.go b/iterator_test.go index d0a766a45..de6640cab 100644 --- a/iterator_test.go +++ b/iterator_test.go @@ -26,8 +26,8 @@ import ( "strings" "testing" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) @@ -162,7 +162,7 @@ func TestIteratePrefix(t *testing.T) { // Benchmark with NO opt.Prefix set === // goos: linux // goarch: amd64 -// pkg: github.com/dgraph-io/badger +// pkg: github.com/dgraph-io/badger/v2 // BenchmarkIteratePrefixSingleKey/Key_lookups-4 10000 460924 ns/op // --- BENCH: BenchmarkIteratePrefixSingleKey/Key_lookups-4 // iterator_test.go:147: Inner b.N: 1 diff --git a/level_handler.go b/level_handler.go index 147967fb8..e88050800 100644 --- a/level_handler.go +++ b/level_handler.go @@ -21,8 +21,8 @@ import ( "sort" "sync" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/levels.go b/levels.go index a4efd6624..4ec6f320c 100644 --- a/levels.go +++ b/levels.go @@ -30,9 +30,9 @@ import ( "golang.org/x/net/trace" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/managed_db_test.go b/managed_db_test.go index ea059e06d..5e679f285 100644 --- a/managed_db_test.go +++ b/managed_db_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) diff --git a/manifest.go b/manifest.go index a58188294..aaf9424dd 100644 --- a/manifest.go +++ b/manifest.go @@ -27,8 +27,8 @@ import ( "path/filepath" "sync" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/manifest_test.go b/manifest_test.go index f5402e9de..12ddeef93 100644 --- a/manifest_test.go +++ b/manifest_test.go @@ -27,10 +27,10 @@ import ( "golang.org/x/net/trace" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) diff --git a/merge.go b/merge.go index 02ad4bcde..569b297d7 100644 --- a/merge.go +++ b/merge.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/options.go b/options.go index 560b65b24..3b5b1956c 100644 --- a/options.go +++ b/options.go @@ -17,7 +17,7 @@ package badger import ( - "github.com/dgraph-io/badger/options" + "github.com/dgraph-io/badger/v2/options" ) // NOTE: Keep the comments in the following to 75 chars width, so they diff --git a/publisher.go b/publisher.go index 24588f5c6..cfc816196 100644 --- a/publisher.go +++ b/publisher.go @@ -20,8 +20,8 @@ import ( "bytes" "sync" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" ) type subscriber struct { diff --git a/publisher_test.go b/publisher_test.go index 18127e388..b0433db70 100644 --- a/publisher_test.go +++ b/publisher_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/dgraph-io/badger/pb" + "github.com/dgraph-io/badger/v2/pb" ) func TestPublisherOrdering(t *testing.T) { diff --git a/skl/arena.go b/skl/arena.go index def550712..dda3b7b85 100644 --- a/skl/arena.go +++ b/skl/arena.go @@ -20,7 +20,7 @@ import ( "sync/atomic" "unsafe" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) const ( diff --git a/skl/skl.go b/skl/skl.go index fc2eff982..2ad88757d 100644 --- a/skl/skl.go +++ b/skl/skl.go @@ -38,7 +38,7 @@ import ( "sync/atomic" "unsafe" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) const ( diff --git a/skl/skl_test.go b/skl/skl_test.go index b0849f386..8ed2b5765 100644 --- a/skl/skl_test.go +++ b/skl/skl_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) const arenaSize = 1 << 20 diff --git a/stream.go b/stream.go index f0841a6a4..66011ad93 100644 --- a/stream.go +++ b/stream.go @@ -24,8 +24,8 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" humanize "github.com/dustin/go-humanize" ) diff --git a/stream_test.go b/stream_test.go index 3e12685d1..85943a279 100644 --- a/stream_test.go +++ b/stream_test.go @@ -26,8 +26,8 @@ import ( "strings" "testing" - bpb "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + bpb "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) diff --git a/stream_writer.go b/stream_writer.go index b134f87cd..2c4242089 100644 --- a/stream_writer.go +++ b/stream_writer.go @@ -19,9 +19,9 @@ package badger import ( "math" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" humanize "github.com/dustin/go-humanize" "github.com/pkg/errors" ) diff --git a/stream_writer_test.go b/stream_writer_test.go index 4358c9835..f77eddca1 100644 --- a/stream_writer_test.go +++ b/stream_writer_test.go @@ -26,8 +26,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/dgraph-io/badger/pb" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/pb" + "github.com/dgraph-io/badger/v2/y" ) func getSortedKVList(valueSize, listSize int) *pb.KVList { diff --git a/structs.go b/structs.go index 51d16cdb2..47ed5bf21 100644 --- a/structs.go +++ b/structs.go @@ -7,7 +7,7 @@ import ( "hash/crc32" "time" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) type valuePointer struct { diff --git a/table/builder.go b/table/builder.go index 0657cbca1..a3cda8765 100644 --- a/table/builder.go +++ b/table/builder.go @@ -23,7 +23,7 @@ import ( "math" "github.com/AndreasBriese/bbloom" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" ) var ( diff --git a/table/iterator.go b/table/iterator.go index 0eb5ed01a..9f1fb7998 100644 --- a/table/iterator.go +++ b/table/iterator.go @@ -22,7 +22,7 @@ import ( "math" "sort" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/table/table.go b/table/table.go index 0a1f42d46..9fc6162d9 100644 --- a/table/table.go +++ b/table/table.go @@ -31,8 +31,8 @@ import ( "sync/atomic" "github.com/AndreasBriese/bbloom" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/table/table_test.go b/table/table_test.go index 3e95b1086..d135c103f 100644 --- a/table/table_test.go +++ b/table/table_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) diff --git a/txn.go b/txn.go index 67411a8f5..f09a09bd7 100644 --- a/txn.go +++ b/txn.go @@ -26,7 +26,7 @@ import ( "sync" "sync/atomic" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/y" farm "github.com/dgryski/go-farm" "github.com/pkg/errors" ) diff --git a/txn_test.go b/txn_test.go index 9a6fccde0..b851b5776 100644 --- a/txn_test.go +++ b/txn_test.go @@ -26,8 +26,8 @@ import ( "testing" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" "github.com/stretchr/testify/require" ) diff --git a/util.go b/util.go index c5173e26c..b7f173dd3 100644 --- a/util.go +++ b/util.go @@ -23,8 +23,8 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger/table" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/table" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" ) diff --git a/value.go b/value.go index f57f1b3ba..c451f0315 100644 --- a/value.go +++ b/value.go @@ -35,8 +35,8 @@ import ( "sync/atomic" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" "github.com/pkg/errors" "golang.org/x/net/trace" ) diff --git a/value_test.go b/value_test.go index 0c0f90de4..4b9c7548a 100644 --- a/value_test.go +++ b/value_test.go @@ -26,8 +26,8 @@ import ( "testing" "time" - "github.com/dgraph-io/badger/options" - "github.com/dgraph-io/badger/y" + "github.com/dgraph-io/badger/v2/options" + "github.com/dgraph-io/badger/v2/y" humanize "github.com/dustin/go-humanize" "github.com/stretchr/testify/require" "golang.org/x/net/trace"