Skip to content

Commit

Permalink
chore(linter): fix order of imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 committed Feb 14, 2023
1 parent aa8c51c commit 524d28f
Show file tree
Hide file tree
Showing 44 changed files with 91 additions and 60 deletions.
5 changes: 3 additions & 2 deletions backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import (
"encoding/binary"
"io"

"github.com/golang/protobuf/proto"
"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
)

// flushThreshold determines when a buffer will be flushed. When performing a
Expand Down
3 changes: 2 additions & 1 deletion backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ import (
"testing"
"time"

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

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

func TestBackupRestore1(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion badger/cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import (
"math"
"os"

"github.com/dgraph-io/badger/v3"
"github.com/spf13/cobra"

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

var bo = struct {
Expand Down
3 changes: 2 additions & 1 deletion badger/cmd/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import (
"sync/atomic"
"time"

"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/spf13/cobra"
)

var testCmd = &cobra.Command{
Expand Down
5 changes: 3 additions & 2 deletions badger/cmd/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"fmt"
"math"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
)

var flattenCmd = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions badger/cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ import (
"strings"
"time"

humanize "github.com/dustin/go-humanize"
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
humanize "github.com/dustin/go-humanize"
"github.com/spf13/cobra"
)

type flagOptions struct {
Expand Down
3 changes: 2 additions & 1 deletion badger/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import (
"os"
"path/filepath"

"github.com/dgraph-io/badger/v3"
"github.com/spf13/cobra"

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

var restoreFile string
Expand Down
4 changes: 2 additions & 2 deletions badger/cmd/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"os"
"time"

"github.com/dgraph-io/badger/v3"

"github.com/spf13/cobra"

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

var oldKeyPath string
Expand Down
3 changes: 2 additions & 1 deletion badger/cmd/rotate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"os"
"testing"

"github.com/stretchr/testify/require"

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

func TestRotate(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions badger/cmd/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import (
"math"
"os"

"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/dgraph-io/badger/v3"
"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/y"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

var streamCmd = &cobra.Command{
Expand Down
5 changes: 3 additions & 2 deletions badger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
_ "net/http/pprof"
"runtime"

"github.com/dgraph-io/badger/v3/badger/cmd"
"github.com/dgraph-io/ristretto/z"
"github.com/dustin/go-humanize"
"go.opencensus.io/zpages"

"github.com/dgraph-io/badger/v3/badger/cmd"
"github.com/dgraph-io/ristretto/z"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"sync"
"sync/atomic"

"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"
)

// WriteBatch holds the necessary info to perform batched writes.
Expand Down
4 changes: 2 additions & 2 deletions batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v3/y"

"github.com/stretchr/testify/require"

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

func TestWriteBatch(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ import (
"sync/atomic"
"time"

humanize "github.com/dustin/go-humanize"
"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/skl"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto"
"github.com/dgraph-io/ristretto/z"
humanize "github.com/dustin/go-humanize"
"github.com/pkg/errors"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions db2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v3/options"
"github.com/stretchr/testify/require"

"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/stretchr/testify/require"
)

func TestTruncateVlogWithClose(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion dir_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"os"
"path/filepath"

"github.com/dgraph-io/badger/v3/y"
"golang.org/x/sys/unix"

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

// directoryLockGuard holds a lock on a directory and a pid file inside. The pid file isn't part
Expand Down
3 changes: 1 addition & 2 deletions iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ import (
"time"

"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/ristretto/z"

"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

type prefetchStatus uint8
Expand Down
3 changes: 2 additions & 1 deletion iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/require"

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

type tableMock struct {
Expand Down
2 changes: 1 addition & 1 deletion levels.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
"sync/atomic"
"time"

"github.com/pkg/errors"
otrace "go.opencensus.io/trace"

"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"
)

type levelsController struct {
Expand Down
3 changes: 2 additions & 1 deletion levels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/stretchr/testify/require"
)

// createAndOpen creates a table with the given data and adds it to the given level.
Expand Down
3 changes: 2 additions & 1 deletion managed_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/stretchr/testify/require"
)

func val(large bool) []byte {
Expand Down
5 changes: 3 additions & 2 deletions manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ import (
"path/filepath"
"sync"

"github.com/golang/protobuf/proto"
"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
)

// Manifest represents the contents of the MANIFEST file in a Badger store.
Expand Down
2 changes: 1 addition & 1 deletion manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
otrace "go.opencensus.io/trace"

"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/stretchr/testify/require"
)

func TestManifestBasic(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion memtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ import (
"sync"
"sync/atomic"

"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/skl"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"
)

// memTable structure stores a skiplist and a corresponding WAL. Writes to memTable are written
Expand Down
3 changes: 2 additions & 1 deletion merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"sync"
"time"

"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"
)

// MergeOperator represents a Badger merge operator.
Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import (
"strings"
"time"

"github.com/dgraph-io/ristretto/z"
"github.com/pkg/errors"

"github.com/dgraph-io/badger/v3/options"
"github.com/dgraph-io/badger/v3/table"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
)

// Note: If you add a new option X make sure you also add a WithX method on Options.
Expand Down
3 changes: 2 additions & 1 deletion pb/badgerpb3.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package badger
import (
"context"
"fmt"
"github.com/pkg/errors"
"sync"
"sync/atomic"
"testing"
"time"

"github.com/pkg/errors"
"github.com/stretchr/testify/require"

"github.com/dgraph-io/badger/v3/pb"
Expand Down
3 changes: 2 additions & 1 deletion stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ import (
"sync/atomic"
"time"

humanize "github.com/dustin/go-humanize"

"github.com/dgraph-io/badger/v3/pb"
"github.com/dgraph-io/badger/v3/y"
"github.com/dgraph-io/ristretto/z"
humanize "github.com/dustin/go-humanize"
)

const batchSize = 16 << 20 // 16 MB
Expand Down
Loading

0 comments on commit 524d28f

Please sign in to comment.