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
# 3. you do repeated runs (false for CI) or cache $GOPATH/pkg or `go env GOCACHE` dir in CI.
use-installed-packages: false
goimports:
local: "storj.io"
golint:
min-confidence: 0.8
gofmt:

View File

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

View File

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

View File

@ -9,11 +9,9 @@ import (
"path/filepath"
"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/cfgstruct"
"storj.io/storj/pkg/kademlia"
"storj.io/storj/pkg/overlay"
mockOverlay "storj.io/storj/pkg/overlay/mocks"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,14 +9,13 @@ import (
"fmt"
"testing"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/google/go-cmp/cmp"
"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/paths"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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