Separate storj.io packages in imports (#481)

Format with goimports -w -local storj.io
Add flag to golang lint
Remove commented out imports as they mess with goimports
This commit is contained in:
Egon Elbre 2018-10-16 14:43:44 +03:00 committed by GitHub
parent 2b2e0996b0
commit 2dbada73ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 59 additions and 50 deletions

View File

@ -65,6 +65,8 @@ linters-settings:
# 2. you use go >= 1.10 # 2. you use go >= 1.10
# 3. you do repeated runs (false for CI) or cache $GOPATH/pkg or `go env GOCACHE` dir in CI. # 3. you do repeated runs (false for CI) or cache $GOPATH/pkg or `go env GOCACHE` dir in CI.
use-installed-packages: false use-installed-packages: false
goimports:
local: "storj.io"
golint: golint:
min-confidence: 0.8 min-confidence: 0.8
gofmt: gofmt:

View File

@ -15,6 +15,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
monkit "gopkg.in/spacemonkeygo/monkit.v2" monkit "gopkg.in/spacemonkeygo/monkit.v2"
"storj.io/storj/internal/memory" "storj.io/storj/internal/memory"
"storj.io/storj/pkg/process" "storj.io/storj/pkg/process"
) )

View File

@ -8,9 +8,9 @@ import (
"net" "net"
"strings" "strings"
"github.com/alicebob/miniredis"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/alicebob/miniredis"
"storj.io/storj/pkg/auth/grpcauth" "storj.io/storj/pkg/auth/grpcauth"
"storj.io/storj/pkg/cfgstruct" "storj.io/storj/pkg/cfgstruct"
"storj.io/storj/pkg/datarepair/checker" "storj.io/storj/pkg/datarepair/checker"

View File

@ -9,11 +9,9 @@ import (
"path/filepath" "path/filepath"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"storj.io/storj/pkg/cfgstruct"
// "storj.io/storj/pkg/datarepair/repairer"
// "storj.io/storj/pkg/datarepair/checker"
"storj.io/storj/pkg/auth/grpcauth" "storj.io/storj/pkg/auth/grpcauth"
"storj.io/storj/pkg/cfgstruct"
"storj.io/storj/pkg/kademlia" "storj.io/storj/pkg/kademlia"
"storj.io/storj/pkg/overlay" "storj.io/storj/pkg/overlay"
mockOverlay "storj.io/storj/pkg/overlay/mocks" mockOverlay "storj.io/storj/pkg/overlay/mocks"

View File

@ -9,6 +9,7 @@ import (
"fmt" "fmt"
"google.golang.org/grpc" "google.golang.org/grpc"
"storj.io/storj/pkg/cfgstruct" "storj.io/storj/pkg/cfgstruct"
"storj.io/storj/pkg/provider" "storj.io/storj/pkg/provider"
) )

View File

@ -10,6 +10,7 @@ import (
time "time" time "time"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
dht "storj.io/storj/pkg/dht" dht "storj.io/storj/pkg/dht"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
) )

View File

@ -9,6 +9,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
) )

View File

@ -12,6 +12,7 @@ import (
"time" "time"
"github.com/zeebo/errs" "github.com/zeebo/errs"
"storj.io/storj/pkg/dht" "storj.io/storj/pkg/dht"
"storj.io/storj/pkg/node" "storj.io/storj/pkg/node"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"

View File

@ -13,9 +13,9 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"google.golang.org/grpc" "google.golang.org/grpc"
"storj.io/storj/pkg/dht/mocks" "storj.io/storj/pkg/dht/mocks"
"storj.io/storj/pkg/node" "storj.io/storj/pkg/node"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
"storj.io/storj/pkg/provider" "storj.io/storj/pkg/provider"
) )

View File

@ -13,9 +13,6 @@ import (
"testing" "testing"
"time" "time"
"storj.io/storj/pkg/storage/meta"
"storj.io/storj/storage"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
minio "github.com/minio/minio/cmd" minio "github.com/minio/minio/cmd"
"github.com/minio/minio/pkg/hash" "github.com/minio/minio/pkg/hash"
@ -25,7 +22,9 @@ import (
"storj.io/storj/pkg/ranger" "storj.io/storj/pkg/ranger"
"storj.io/storj/pkg/storage/buckets" "storj.io/storj/pkg/storage/buckets"
mock_buckets "storj.io/storj/pkg/storage/buckets/mocks" mock_buckets "storj.io/storj/pkg/storage/buckets/mocks"
"storj.io/storj/pkg/storage/meta"
"storj.io/storj/pkg/storage/objects" "storj.io/storj/pkg/storage/objects"
"storj.io/storj/storage"
) )
var ( var (

View File

@ -5,8 +5,9 @@
package logging package logging
import ( import (
gomock "github.com/golang/mock/gomock"
reflect "reflect" reflect "reflect"
gomock "github.com/golang/mock/gomock"
) )
// MockErrorLogger is a mock of ErrorLogger interface // MockErrorLogger is a mock of ErrorLogger interface

View File

@ -11,13 +11,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/minio/minio/pkg/madmin"
policy "github.com/minio/minio/pkg/policy"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
minio "github.com/minio/minio/cmd" minio "github.com/minio/minio/cmd"
"github.com/minio/minio/pkg/auth" "github.com/minio/minio/pkg/auth"
"github.com/minio/minio/pkg/hash" "github.com/minio/minio/pkg/hash"
"github.com/minio/minio/pkg/madmin"
policy "github.com/minio/minio/pkg/policy"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"go.uber.org/zap" "go.uber.org/zap"
) )

View File

@ -10,6 +10,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/zeebo/errs" "github.com/zeebo/errs"
"storj.io/storj/pkg/kademlia" "storj.io/storj/pkg/kademlia"
) )

View File

@ -9,6 +9,7 @@ import (
reflect "reflect" reflect "reflect"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
dht "storj.io/storj/pkg/dht" dht "storj.io/storj/pkg/dht"
x "storj.io/storj/pkg/overlay" x "storj.io/storj/pkg/overlay"
pb "storj.io/storj/pkg/pb" pb "storj.io/storj/pkg/pb"

View File

@ -10,12 +10,11 @@ import (
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
"github.com/zeebo/errs" "github.com/zeebo/errs"
"go.uber.org/zap" "go.uber.org/zap"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
"gopkg.in/spacemonkeygo/monkit.v2" "gopkg.in/spacemonkeygo/monkit.v2"
"storj.io/storj/pkg/dht"
"storj.io/storj/pkg/dht"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
"storj.io/storj/storage" "storj.io/storj/storage"
) )

View File

@ -13,13 +13,12 @@ import (
"log" "log"
"time" "time"
"github.com/gtank/cryptopasta"
"github.com/zeebo/errs" "github.com/zeebo/errs"
"go.uber.org/zap" "go.uber.org/zap"
"golang.org/x/net/context" "golang.org/x/net/context"
"google.golang.org/grpc" "google.golang.org/grpc"
"github.com/gtank/cryptopasta"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
"storj.io/storj/pkg/ranger" "storj.io/storj/pkg/ranger"
) )

View File

@ -9,6 +9,7 @@ import (
"github.com/mr-tron/base58/base58" "github.com/mr-tron/base58/base58"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"storj.io/storj/pkg/dht" "storj.io/storj/pkg/dht"
"storj.io/storj/pkg/node" "storj.io/storj/pkg/node"
"storj.io/storj/pkg/provider" "storj.io/storj/pkg/provider"

View File

@ -15,7 +15,6 @@ import (
"time" "time"
_ "github.com/mattn/go-sqlite3" // register sqlite to sql _ "github.com/mattn/go-sqlite3" // register sqlite to sql
"go.uber.org/zap" "go.uber.org/zap"
monkit "gopkg.in/spacemonkeygo/monkit.v2" monkit "gopkg.in/spacemonkeygo/monkit.v2"

View File

@ -14,9 +14,9 @@ import (
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"storj.io/storj/pkg/pb"
"golang.org/x/net/context" "golang.org/x/net/context"
"storj.io/storj/pkg/pb"
) )
var ctx = context.Background() var ctx = context.Background()

View File

@ -5,6 +5,7 @@ package server
import ( import (
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
"storj.io/storj/pkg/utils" "storj.io/storj/pkg/utils"
) )

View File

@ -19,6 +19,7 @@ import (
"go.uber.org/zap" "go.uber.org/zap"
"golang.org/x/net/context" "golang.org/x/net/context"
monkit "gopkg.in/spacemonkeygo/monkit.v2" monkit "gopkg.in/spacemonkeygo/monkit.v2"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
"storj.io/storj/pkg/peertls" "storj.io/storj/pkg/peertls"
pstore "storj.io/storj/pkg/piecestore" pstore "storj.io/storj/pkg/piecestore"

View File

@ -9,6 +9,7 @@ import (
"log" "log"
"github.com/zeebo/errs" "github.com/zeebo/errs"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
pstore "storj.io/storj/pkg/piecestore" pstore "storj.io/storj/pkg/piecestore"
"storj.io/storj/pkg/utils" "storj.io/storj/pkg/utils"

View File

@ -9,6 +9,7 @@ import (
reflect "reflect" reflect "reflect"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
paths "storj.io/storj/pkg/paths" paths "storj.io/storj/pkg/paths"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
"storj.io/storj/pkg/pointerdb/pdbclient" "storj.io/storj/pkg/pointerdb/pdbclient"

View File

@ -13,6 +13,7 @@ import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
) )

View File

@ -9,14 +9,13 @@ import (
"fmt" "fmt"
"testing" "testing"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"storj.io/storj/pkg/auth" "storj.io/storj/pkg/auth"
"storj.io/storj/pkg/paths" "storj.io/storj/pkg/paths"

View File

@ -8,7 +8,10 @@ import (
"crypto" "crypto"
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"encoding/base64"
"fmt"
"io/ioutil" "io/ioutil"
"math/bits"
"net" "net"
"os" "os"
@ -18,10 +21,6 @@ import (
"google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials"
"google.golang.org/grpc/peer" "google.golang.org/grpc/peer"
"encoding/base64"
"fmt"
"math/bits"
"storj.io/storj/pkg/peertls" "storj.io/storj/pkg/peertls"
"storj.io/storj/pkg/utils" "storj.io/storj/pkg/utils"
) )

View File

@ -6,11 +6,10 @@ package ranger
import ( import (
"context" "context"
"net/http" "net/http"
"net/http/httptest"
"testing" "testing"
"time" "time"
"net/http/httptest"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -10,7 +10,6 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
"testing" "testing"
) )

View File

@ -9,9 +9,8 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"go.uber.org/zap"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"go.uber.org/zap"
dbx "storj.io/storj/pkg/statdb/dbx" dbx "storj.io/storj/pkg/statdb/dbx"
pb "storj.io/storj/pkg/statdb/proto" pb "storj.io/storj/pkg/statdb/proto"

View File

@ -9,6 +9,7 @@ import (
reflect "reflect" reflect "reflect"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
buckets "storj.io/storj/pkg/storage/buckets" buckets "storj.io/storj/pkg/storage/buckets"
objects "storj.io/storj/pkg/storage/objects" objects "storj.io/storj/pkg/storage/objects"
) )

View File

@ -10,7 +10,6 @@ import (
minio "github.com/minio/minio/cmd" minio "github.com/minio/minio/cmd"
"github.com/zeebo/errs" "github.com/zeebo/errs"
monkit "gopkg.in/spacemonkeygo/monkit.v2" monkit "gopkg.in/spacemonkeygo/monkit.v2"
"storj.io/storj/pkg/paths" "storj.io/storj/pkg/paths"

View File

@ -11,13 +11,15 @@ package ecclient
import ( import (
context "context" context "context"
gomock "github.com/golang/mock/gomock"
io "io" io "io"
reflect "reflect" reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
pb "storj.io/storj/pkg/pb" pb "storj.io/storj/pkg/pb"
client "storj.io/storj/pkg/piecestore/rpc/client" client "storj.io/storj/pkg/piecestore/rpc/client"
ranger "storj.io/storj/pkg/ranger" ranger "storj.io/storj/pkg/ranger"
time "time"
) )
// MockPSClient is a mock of PSClient interface // MockPSClient is a mock of PSClient interface

View File

@ -13,6 +13,7 @@ import (
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
) )

View File

@ -10,7 +10,6 @@ import (
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
"github.com/zeebo/errs" "github.com/zeebo/errs"
"go.uber.org/zap" "go.uber.org/zap"
monkit "gopkg.in/spacemonkeygo/monkit.v2" monkit "gopkg.in/spacemonkeygo/monkit.v2"

View File

@ -11,6 +11,7 @@ import (
time "time" time "time"
gomock "github.com/golang/mock/gomock" gomock "github.com/golang/mock/gomock"
paths "storj.io/storj/pkg/paths" paths "storj.io/storj/pkg/paths"
ranger "storj.io/storj/pkg/ranger" ranger "storj.io/storj/pkg/ranger"
) )

View File

@ -9,10 +9,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/golang/protobuf/ptypes"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"storj.io/storj/pkg/eestream" "storj.io/storj/pkg/eestream"
mock_eestream "storj.io/storj/pkg/eestream/mocks" mock_eestream "storj.io/storj/pkg/eestream/mocks"
mock_overlay "storj.io/storj/pkg/overlay/mocks" mock_overlay "storj.io/storj/pkg/overlay/mocks"

View File

@ -14,6 +14,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"storj.io/storj/pkg/paths" "storj.io/storj/pkg/paths"
"storj.io/storj/pkg/pb" "storj.io/storj/pkg/pb"
ranger "storj.io/storj/pkg/ranger" ranger "storj.io/storj/pkg/ranger"

View File

@ -7,10 +7,10 @@ import (
"bytes" "bytes"
"time" "time"
"github.com/boltdb/bolt"
"storj.io/storj/pkg/utils" "storj.io/storj/pkg/utils"
"storj.io/storj/storage" "storj.io/storj/storage"
"github.com/boltdb/bolt"
) )
// Client is the entrypoint into a bolt data store // Client is the entrypoint into a bolt data store

View File

@ -21,6 +21,7 @@ import (
"github.com/alicebob/miniredis" "github.com/alicebob/miniredis"
"github.com/go-redis/redis" "github.com/go-redis/redis"
"storj.io/storj/internal/processgroup" "storj.io/storj/internal/processgroup"
) )

View File

@ -7,9 +7,9 @@ import (
"strconv" "strconv"
"sync/atomic" "sync/atomic"
"storj.io/storj/storage"
"go.uber.org/zap" "go.uber.org/zap"
"storj.io/storj/storage"
) )
var id int64 var id int64

View File

@ -6,10 +6,10 @@ package storelogger
import ( import (
"testing" "testing"
"go.uber.org/zap"
"storj.io/storj/storage/teststore" "storj.io/storj/storage/teststore"
"storj.io/storj/storage/testsuite" "storj.io/storj/storage/testsuite"
"go.uber.org/zap"
) )
func TestSuite(t *testing.T) { func TestSuite(t *testing.T) {

View File

@ -7,10 +7,10 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"storj.io/storj/storage"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"storj.io/storj/storage"
) )
func testList(t *testing.T, store storage.KeyValueStore) { func testList(t *testing.T, store storage.KeyValueStore) {

View File

@ -8,10 +8,10 @@ import (
"sort" "sort"
"testing" "testing"
"storj.io/storj/storage"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"storj.io/storj/storage"
) )
func testListV2(t *testing.T, store storage.KeyValueStore) { func testListV2(t *testing.T, store storage.KeyValueStore) {

View File

@ -6,10 +6,10 @@ package testsuite
import ( import (
"testing" "testing"
"storj.io/storj/storage"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"storj.io/storj/storage"
) )
func newItem(key, value string, isPrefix bool) storage.ListItem { func newItem(key, value string, isPrefix bool) storage.ListItem {