Skip to content

Commit

Permalink
Removing support for Go Modules
Browse files Browse the repository at this point in the history
As explained in https://discuss.dgraph.io/t/go-modules-on-badger-and-dgraph/4662,
Go Modules force an import path rename that currently breaks support for most other
dependency management systems, including dep.

It seems an effort is being made to add support for this import path renaming by
patching the go tool itself, but until the community hasn't settled and Go Modules
is an easier option to adopt, we are simply not supporting them.

For those willing to use badger v2 from Go modules it is still very simple, you might
notice that once you set the version to be v2.0.0 a +incompatible will be added to it
indicating the dependency has not opted-in into Go Modules. That's normal and not to
be a concern.
  • Loading branch information
campoy committed Jun 25, 2019
1 parent 91ce687 commit 04ca2be
Show file tree
Hide file tree
Showing 48 changed files with 94 additions and 140 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ few months. The [Changelog] is kept fairly up-to-date.
To start using Badger, install Go 1.11 or above and run `go get`:

```sh
$ go get github.com/dgraph-io/badger/v2/...
$ go get github.com/dgraph-io/badger/...
```

This will retrieve the library and install the `badger` command line
Expand All @@ -76,7 +76,7 @@ package main
import (
"log"

badger "github.com/dgraph-io/badger/v2"
badger "github.com/dgraph-io/badger"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ build_script:
test_script:
# Unit tests
- ps: Add-AppveyorTest "Unit Tests" -Outcome Running
- go test -v github.com/dgraph-io/badger/v2/...
- go test -v -vlog_mmap=false github.com/dgraph-io/badger/v2/...
- go test -v github.com/dgraph-io/badger/...
- go test -v -vlog_mmap=false github.com/dgraph-io/badger/...
- ps: Update-AppveyorTest "Unit Tests" -Outcome Passed

notifications:
Expand Down
4 changes: 2 additions & 2 deletions backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"encoding/binary"
"io"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/y"
)

// Backup is a wrapper function over Stream.Backup to generate full and incremental backups of the
Expand Down
2 changes: 1 addition & 1 deletion backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/pb"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions badger/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"bufio"
"os"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/y"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions badger/cmd/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
"sync/atomic"
"time"

"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/dgraph-io/badger"
"github.com/dgraph-io/badger/options"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/y"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cmd

import (
"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions badger/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import (

"github.com/pkg/errors"

"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"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/options"
"github.com/dgraph-io/badger/table"
"github.com/dgraph-io/badger/y"
humanize "github.com/dustin/go-humanize"
"github.com/spf13/cobra"
)
Expand Down
8 changes: 4 additions & 4 deletions badger/cmd/read_bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (
humanize "github.com/dustin/go-humanize"
"github.com/spf13/cobra"

"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/dgraph-io/badger"
"github.com/dgraph-io/badger/options"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/y"
)

var readBenchCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion badger/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"
"path"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions badger/cmd/write_bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
humanize "github.com/dustin/go-humanize"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/y"
)

var writeBenchCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion badger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
_ "net/http/pprof"
"runtime"

"github.com/dgraph-io/badger/v2/badger/cmd"
"github.com/dgraph-io/badger/badger/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package badger
import (
"sync"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/y"
)

// WriteBatch holds the necessary info to perform batched writes.
Expand Down
4 changes: 2 additions & 2 deletions compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (

"golang.org/x/net/trace"

"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/table"
"github.com/dgraph-io/badger/y"
)

type keyRange struct {
Expand Down
10 changes: 5 additions & 5 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ import (
"sync/atomic"
"time"

"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"
"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"
humanize "github.com/dustin/go-humanize"
"github.com/pkg/errors"
"golang.org/x/net/trace"
Expand Down
8 changes: 4 additions & 4 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import (
"testing"
"time"

"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/options"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/skl"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/y"
"github.com/stretchr/testify/require"
)

Expand Down
18 changes: 0 additions & 18 deletions go.mod

This file was deleted.

28 changes: 0 additions & 28 deletions go.sum

This file was deleted.

6 changes: 3 additions & 3 deletions integration/testgc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/badger/v2"
"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/options"
"github.com/dgraph-io/badger/y"
)

var maxValue int64 = 10000000
Expand Down
6 changes: 3 additions & 3 deletions iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/options"
"github.com/dgraph-io/badger/table"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/y"
)

type prefetchStatus uint8
Expand Down
6 changes: 3 additions & 3 deletions iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"strings"
"testing"

"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/options"
"github.com/dgraph-io/badger/y"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -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/v2
// pkg: github.com/dgraph-io/badger
// BenchmarkIteratePrefixSingleKey/Key_lookups-4 10000 460924 ns/op
// --- BENCH: BenchmarkIteratePrefixSingleKey/Key_lookups-4
// iterator_test.go:147: Inner b.N: 1
Expand Down
4 changes: 2 additions & 2 deletions level_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"sort"
"sync"

"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/table"
"github.com/dgraph-io/badger/y"
"github.com/pkg/errors"
)

Expand Down
6 changes: 3 additions & 3 deletions levels.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

"golang.org/x/net/trace"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/table"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/table"
"github.com/dgraph-io/badger/y"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion managed_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/y"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"path/filepath"
"sync"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/y"
"github.com/pkg/errors"
)

Expand Down
8 changes: 4 additions & 4 deletions manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

"golang.org/x/net/trace"

"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/dgraph-io/badger/options"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/table"
"github.com/dgraph-io/badger/y"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sync"
"time"

"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/y"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package badger

import (
"github.com/dgraph-io/badger/v2/options"
"github.com/dgraph-io/badger/options"
)

// Note: If you add a new option X make sure you also add a WithX method on Options.
Expand Down
4 changes: 2 additions & 2 deletions publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"bytes"
"sync"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/v2/y"
"github.com/dgraph-io/badger/pb"
"github.com/dgraph-io/badger/y"
)

type subscriber struct {
Expand Down
2 changes: 1 addition & 1 deletion publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/dgraph-io/badger/v2/pb"
"github.com/dgraph-io/badger/pb"
)

func TestPublisherOrdering(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion skl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ Showing top 10 nodes out of 41 (cum >= 185.62MB)
0 signals received
46434 voluntary context switches
597049 involuntary context switches
```
```
Loading

0 comments on commit 04ca2be

Please sign in to comment.