Skip to content

Commit

Permalink
*: sort all the imports
Browse files Browse the repository at this point in the history
Pick up a new version of crlfmt which consistently sorts all of our
imports into two groups: standard library and non-standard library
imports.

This import sorting is compatible with both gofmt and goimports; that
is, upon seeing this import sorting, neither gofmt nor goimports will
feel compelled to change it. In fact, recent versions of goimports will
attempt to create the same grouping, though goimports is less smart
about combining multiple import blocks together.

Note that the crlfmt bump also picks up a fix for a minor bug in how
shorthand function arguments are formatted.

Release note: None
  • Loading branch information
benesch committed Dec 6, 2018
1 parent 59601df commit 2558dcc
Show file tree
Hide file tree
Showing 572 changed files with 952 additions and 1,683 deletions.
10 changes: 7 additions & 3 deletions Gopkg.lock

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

3 changes: 1 addition & 2 deletions pkg/acceptance/cluster/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"strings"
"time"

"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
Expand All @@ -39,8 +40,6 @@ import (
"github.com/docker/go-connections/nat"
isatty "github.com/mattn/go-isatty"
"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/util/log"
)

// Retrieve the IP address of docker itself.
Expand Down
17 changes: 8 additions & 9 deletions pkg/acceptance/cluster/dockercluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ import (
"testing"
"time"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/go-connections/nat"
"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/config"
"github.com/cockroachdb/cockroach/pkg/security"
Expand All @@ -53,6 +44,14 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/cockroach/pkg/util/uuid"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/stdcopy"
"github.com/docker/go-connections/nat"
"github.com/pkg/errors"
)

const (
Expand Down
9 changes: 4 additions & 5 deletions pkg/acceptance/localcluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ import (
"text/tabwriter"
"time"

"github.com/gogo/protobuf/proto"
"github.com/pkg/errors"
// Import postgres driver.
_ "github.com/lib/pq"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/config"
"github.com/cockroachdb/cockroach/pkg/roachpb"
Expand All @@ -55,6 +50,10 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/cockroach/pkg/util/tracing"
"github.com/gogo/protobuf/proto"
// Import postgres driver.
_ "github.com/lib/pq"
"github.com/pkg/errors"
)

func repoRoot() string {
Expand Down
4 changes: 1 addition & 3 deletions pkg/acceptance/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

package acceptance

import (
"testing"
)
import "testing"

func TestMain(m *testing.M) {
MainTest(m)
Expand Down
4 changes: 1 addition & 3 deletions pkg/base/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

package base

import (
"github.com/cockroachdb/cockroach/pkg/build"
)
import "github.com/cockroachdb/cockroach/pkg/build"

// DocsURLBase is the root URL for the version of the docs associated with this
// binary.
Expand Down
7 changes: 3 additions & 4 deletions pkg/base/store_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ import (
"strconv"
"strings"

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

"github.com/cockroachdb/cockroach/pkg/cli/cliflags"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/util/humanizeutil"
"github.com/dustin/go-humanize"
"github.com/pkg/errors"
"github.com/spf13/pflag"
)

// This file implements method receivers for members of server.Config struct
Expand Down
8 changes: 3 additions & 5 deletions pkg/bench/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@ import (
"math/rand"
"reflect"
"runtime"
"strconv"
"strings"
"sync/atomic"
"testing"

_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"

"strconv"

"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
)

func runBenchmarkSelect1(b *testing.B, db *gosql.DB) {
Expand Down
5 changes: 2 additions & 3 deletions pkg/bench/foreachdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ import (
"strings"
"testing"

_ "github.com/go-sql-driver/mysql" // registers the MySQL driver to gosql
_ "github.com/lib/pq" // registers the pg driver to gosql

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
_ "github.com/go-sql-driver/mysql" // registers the MySQL driver to gosql
_ "github.com/lib/pq" // registers the pg driver to gosql
)

func benchmarkCockroach(b *testing.B, f func(b *testing.B, db *gosql.DB)) {
Expand Down
3 changes: 1 addition & 2 deletions pkg/ccl/backupccl/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"sort"
"time"

"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/build"
"github.com/cockroachdb/cockroach/pkg/ccl/storageccl"
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl"
Expand All @@ -43,6 +41,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/cockroach/pkg/util/tracing"
"github.com/pkg/errors"
)

const (
Expand Down
1 change: 0 additions & 1 deletion pkg/ccl/backupccl/backup_cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"testing"

"github.com/aws/aws-sdk-go/aws/credentials"

"github.com/cockroachdb/cockroach/pkg/ccl/storageccl"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
Expand Down
12 changes: 5 additions & 7 deletions pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ import (
"testing"
"time"

"github.com/cockroachdb/cockroach/pkg/storage"

"github.com/cockroachdb/cockroach-go/crdb"
"github.com/gogo/protobuf/proto"
"github.com/kr/pretty"
"github.com/pkg/errors"
"golang.org/x/sync/errgroup"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/ccl/backupccl"
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl/sampledataccl"
Expand All @@ -47,6 +40,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/jobutils"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
Expand All @@ -59,6 +53,10 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/cockroach/pkg/workload"
"github.com/cockroachdb/cockroach/pkg/workload/bank"
"github.com/gogo/protobuf/proto"
"github.com/kr/pretty"
"github.com/pkg/errors"
"golang.org/x/sync/errgroup"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions pkg/ccl/backupccl/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import (
"sort"
"sync/atomic"

opentracing "github.com/opentracing/opentracing-go"
"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/ccl/gossipccl"
"github.com/cockroachdb/cockroach/pkg/ccl/storageccl"
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl"
Expand All @@ -42,6 +39,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/protoutil"
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/tracing"
opentracing "github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
)

// TableRewriteMap maps old table IDs to new table and parent IDs.
Expand Down
5 changes: 2 additions & 3 deletions pkg/ccl/baseccl/encryption_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ import (
"strings"
"time"

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

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/ccl/cliccl/cliflagsccl"
"github.com/cockroachdb/cockroach/pkg/util/protoutil"
"github.com/pkg/errors"
"github.com/spf13/pflag"
)

// DefaultRotationPeriod is the rotation period used if not specified.
Expand Down
4 changes: 1 addition & 3 deletions pkg/ccl/buildccl/buildinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

package buildccl

import (
"github.com/cockroachdb/cockroach/pkg/build"
)
import "github.com/cockroachdb/cockroach/pkg/build"

func init() {
build.Distribution = "CCL"
Expand Down
7 changes: 2 additions & 5 deletions pkg/ccl/changefeedccl/avro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ import (
"time"

"github.com/cockroachdb/apd"

"github.com/stretchr/testify/require"

"github.com/cockroachdb/cockroach/pkg/ccl/importccl"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/sql/parser"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)

func parseTableDesc(createTableStmt string) (*sqlbase.TableDescriptor, error) {
Expand Down
3 changes: 1 addition & 2 deletions pkg/ccl/changefeedccl/changefeed_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
"sort"
"time"

"github.com/cockroachdb/cockroach/pkg/util/retry"

"github.com/cockroachdb/cockroach/pkg/ccl/backupccl"
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl"
"github.com/cockroachdb/cockroach/pkg/internal/client"
Expand All @@ -29,6 +27,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/retry"
"github.com/cockroachdb/cockroach/pkg/util/tracing"
"github.com/pkg/errors"
)
Expand Down
5 changes: 2 additions & 3 deletions pkg/ccl/changefeedccl/changefeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import (
"testing"
"time"

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

"github.com/cockroachdb/apd"
"github.com/cockroachdb/cockroach-go/crdb"
"github.com/cockroachdb/cockroach/pkg/base"
Expand All @@ -41,6 +38,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/protoutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)

func TestChangefeedBasics(t *testing.T) {
Expand Down
22 changes: 9 additions & 13 deletions pkg/ccl/changefeedccl/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,29 @@ import (
"testing"
"time"

"github.com/cockroachdb/apd"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/internal/client"
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/security"
"github.com/cockroachdb/cockroach/pkg/server"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/distsqlrun"
"github.com/cockroachdb/cockroach/pkg/sql/parser"
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/testutils"

"github.com/cockroachdb/apd"
"github.com/cockroachdb/cockroach/pkg/security"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"

"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/workload"
"github.com/pkg/errors"

"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/sqlbase"
"github.com/cockroachdb/cockroach/pkg/util/hlc"

"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
)

type benchSink struct {
Expand Down
3 changes: 1 addition & 2 deletions pkg/ccl/changefeedccl/sink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/Shopify/sarama"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
Expand All @@ -26,6 +24,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)

type asyncProducerMock struct {
Expand Down
Loading

0 comments on commit 2558dcc

Please sign in to comment.