Skip to content

Commit

Permalink
chore: fix imports order across the repo (#8618)
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 authored Jan 20, 2023
1 parent 0ba4e26 commit cbec230
Show file tree
Hide file tree
Showing 318 changed files with 1,241 additions and 1,040 deletions.
3 changes: 2 additions & 1 deletion algo/packed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"math"
"testing"

"github.com/stretchr/testify/require"

"github.com/dgraph-io/dgraph/codec"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/stretchr/testify/require"
)

func newUidPack(data []uint64) *pb.UidPack {
Expand Down
3 changes: 2 additions & 1 deletion algo/uidlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/dgraph-io/dgraph/codec"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/stretchr/testify/require"
)

func newList(data []uint64) *pb.List {
Expand Down
4 changes: 2 additions & 2 deletions chunker/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (
"strings"
"unicode"

"github.com/pkg/errors"

"github.com/dgraph-io/dgraph/ee/enc"
"github.com/dgraph-io/dgraph/lex"
"github.com/dgraph-io/dgraph/x"

"github.com/pkg/errors"
)

// Chunker describes the interface to parse and process the input to the live and bulk loaders.
Expand Down
7 changes: 4 additions & 3 deletions chunker/json_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ import (
"sync/atomic"
"unicode"

"github.com/pkg/errors"
geom "github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/encoding/geojson"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/types"
"github.com/dgraph-io/dgraph/types/facets"
"github.com/dgraph-io/dgraph/x"
simdjson "github.com/dgraph-io/simdjson-go"
"github.com/pkg/errors"
geom "github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/encoding/geojson"
)

func stripSpaces(str string) string {
Expand Down
6 changes: 3 additions & 3 deletions chunker/json_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
"testing"
"time"

"github.com/dgraph-io/dgraph/testutil"
"github.com/dgraph-io/dgraph/tok"
"github.com/golang/glog"
"github.com/stretchr/testify/require"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/testutil"
"github.com/dgraph-io/dgraph/tok"
"github.com/dgraph-io/dgraph/types"
"github.com/stretchr/testify/require"
)

func makeNquad(sub, pred string, val *api.Value) *api.NQuad {
Expand Down
3 changes: 2 additions & 1 deletion chunker/rdf_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import (
"strings"
"unicode"

"github.com/pkg/errors"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/lex"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/types"
"github.com/dgraph-io/dgraph/types/facets"
"github.com/dgraph-io/dgraph/x"
"github.com/pkg/errors"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion chunker/rdf_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ package chunker
import (
"testing"

"github.com/stretchr/testify/require"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/lex"
"github.com/dgraph-io/dgraph/types/facets"
"github.com/dgraph-io/dgraph/x"
"github.com/stretchr/testify/require"
)

var testNQuads = []struct {
Expand Down
3 changes: 2 additions & 1 deletion chunker/rdf_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ func lexLabel(l *lex.Lexer) lex.StateFn {

// lexFacets parses key-value pairs of Facets. sample is :
// ( key1 = "value1", key2=13, key3=, key4 =2.4, key5=2006-01-02T15:04:05,
// key6=2006-01-02 )
//
// key6=2006-01-02 )
func lexFacets(l *lex.Lexer) lex.StateFn {
r := l.Next()
if r != leftRound {
Expand Down
3 changes: 2 additions & 1 deletion codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import (
"sort"
"unsafe"

"github.com/dgryski/go-groupvarint"

"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
"github.com/dgraph-io/ristretto/z"
"github.com/dgryski/go-groupvarint"
)

type seekPos int
Expand Down
5 changes: 3 additions & 2 deletions codec/codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ import (
"testing"
"time"

humanize "github.com/dustin/go-humanize"
"github.com/stretchr/testify/require"

"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
"github.com/dgraph-io/ristretto/z"
humanize "github.com/dustin/go-humanize"
"github.com/stretchr/testify/require"
)

func getUids(size int) []uint64 {
Expand Down
5 changes: 3 additions & 2 deletions conn/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ import (
"testing"
"time"

"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/raftwal"
"github.com/stretchr/testify/require"
"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/raft/raftpb"

"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/raftwal"
)

func (n *Node) run(wg *sync.WaitGroup) {
Expand Down
10 changes: 5 additions & 5 deletions conn/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ import (
"sync"
"time"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
"github.com/dgraph-io/ristretto/z"
"github.com/golang/glog"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ocgrpc"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
"github.com/dgraph-io/ristretto/z"
)

var (
Expand Down
7 changes: 4 additions & 3 deletions conn/raft_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
"github.com/golang/glog"
"github.com/pkg/errors"
"go.etcd.io/etcd/raft/raftpb"
otrace "go.opencensus.io/trace"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/protos/pb"
"github.com/dgraph-io/dgraph/x"
)

type sendmsg struct {
Expand Down
5 changes: 3 additions & 2 deletions contrib/integration/bank/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ import (
"sync/atomic"
"time"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials"

"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/x"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion contrib/integration/bigdata/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ import (
"sync/atomic"
"time"

"google.golang.org/grpc"

"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/x"
"google.golang.org/grpc"
)

var addrs = flag.String("addrs", "", "comma separated dgraph addresses")
Expand Down
3 changes: 2 additions & 1 deletion contrib/integration/mutates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import (
"fmt"
"log"

"google.golang.org/grpc"

"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/x"
"google.golang.org/grpc"
)

var alpha = flag.String("alpha", "localhost:9080", "Dgraph alpha addr")
Expand Down
3 changes: 2 additions & 1 deletion contrib/integration/swap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ import (
"sync/atomic"
"time"

"github.com/pkg/errors"

"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/testutil"
"github.com/dgraph-io/dgraph/x"
"github.com/pkg/errors"
)

var (
Expand Down
5 changes: 3 additions & 2 deletions contrib/integration/testtxn/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/testutil"
"github.com/dgraph-io/dgraph/x"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

type state struct {
Expand Down
3 changes: 2 additions & 1 deletion contrib/jepsen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ import (
"sync"
"time"

"github.com/dgraph-io/dgraph/contrib/jepsen/browser"
"github.com/spf13/pflag"

"github.com/dgraph-io/dgraph/contrib/jepsen/browser"
)

type jepsenTest struct {
Expand Down
1 change: 0 additions & 1 deletion dgraph/cmd/alpha/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"strings"

"github.com/dgraph-io/dgraph/graphql/admin"

"github.com/dgraph-io/dgraph/graphql/schema"
"github.com/dgraph-io/dgraph/worker"
"github.com/dgraph-io/dgraph/x"
Expand Down
5 changes: 3 additions & 2 deletions dgraph/cmd/alpha/admin_backup.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !oss
// +build !oss

/*
Expand All @@ -21,10 +22,10 @@ package alpha
import (
"net/http"

"github.com/dgraph-io/dgraph/graphql/schema"
"github.com/golang/glog"

"github.com/dgraph-io/dgraph/graphql/schema"
"github.com/dgraph-io/dgraph/x"
"github.com/golang/glog"
)

func init() {
Expand Down
10 changes: 5 additions & 5 deletions dgraph/cmd/alpha/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ import (
"sync/atomic"
"time"

"github.com/dgraph-io/dgraph/graphql/admin"
"github.com/gogo/protobuf/jsonpb"
"github.com/golang/glog"
"github.com/pkg/errors"
"google.golang.org/grpc/metadata"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/dql"
"github.com/dgraph-io/dgraph/edgraph"
"github.com/dgraph-io/dgraph/graphql/admin"
"github.com/dgraph-io/dgraph/graphql/schema"
"github.com/dgraph-io/dgraph/query"
"github.com/dgraph-io/dgraph/x"
"github.com/gogo/protobuf/jsonpb"
"github.com/golang/glog"
"github.com/pkg/errors"
"google.golang.org/grpc/metadata"
)

func allowed(method string) bool {
Expand Down
4 changes: 3 additions & 1 deletion dgraph/cmd/alpha/login_ee.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !oss
// +build !oss

/*
Expand All @@ -17,10 +18,11 @@ import (
"encoding/json"
"net/http"

"github.com/golang/glog"

"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/edgraph"
"github.com/dgraph-io/dgraph/x"
"github.com/golang/glog"
)

func loginHandler(w http.ResponseWriter, r *http.Request) {
Expand Down
6 changes: 3 additions & 3 deletions dgraph/cmd/alpha/mutations_mode/mutations_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/require"
"google.golang.org/grpc"

"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"
"github.com/dgraph-io/dgraph/testutil"
"github.com/stretchr/testify/require"

"google.golang.org/grpc"
)

// Tests in this file require a cluster running with the --limit "mutations=<mode>;" flag.
Expand Down
Loading

0 comments on commit cbec230

Please sign in to comment.