Skip to content

Commit

Permalink
Merge pull request #14534 from demoManito/feat/golangci
Browse files Browse the repository at this point in the history
golangci: add import order check
  • Loading branch information
ahrtr authored Sep 29, 2022
2 parents d379e62 + 7020e2f commit cd9764a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ linters:
# - deadcode
# - structcheck
# - varcheck
- goimports
- ineffassign
- revive
- staticcheck
- stylecheck
- unused
- unconvert # Remove unnecessary type conversions
- revive

linters-settings: # please keep this alphabetized
goimports:
local-prefixes: go.etcd.io # Put imports beginning with prefix after 3rd-party packages.
staticcheck:
checks:
- "all"
Expand Down
3 changes: 2 additions & 1 deletion tools/benchmark/cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"strings"

"github.com/bgentry/speakeasy"
"google.golang.org/grpc/grpclog"

clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/pkg/v3/report"
"google.golang.org/grpc/grpclog"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions tools/benchmark/cmd/watch_latency.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"sync"
"time"

"go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/pkg/v3/report"

"github.com/cheggaaa/pb/v3"
"github.com/spf13/cobra"
"golang.org/x/time/rate"

clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/pkg/v3/report"
)

// watchLatencyCmd represents the watch latency command
Expand Down
7 changes: 3 additions & 4 deletions tools/etcd-dump-db/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ import (
"fmt"
"path/filepath"

"go.etcd.io/etcd/api/v3/authpb"
"go.etcd.io/etcd/server/v3/storage/schema"
"go.uber.org/zap"

bolt "go.etcd.io/bbolt"
"go.etcd.io/etcd/api/v3/authpb"
"go.etcd.io/etcd/api/v3/mvccpb"
"go.etcd.io/etcd/server/v3/lease/leasepb"
"go.etcd.io/etcd/server/v3/storage/backend"

bolt "go.etcd.io/bbolt"
"go.etcd.io/etcd/server/v3/storage/schema"
)

func snapDir(dataDir string) string {
Expand Down
3 changes: 2 additions & 1 deletion tools/etcd-dump-logs/etcd-dump-log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ import (
"strings"
"testing"

"go.uber.org/zap/zaptest"

"go.etcd.io/etcd/api/v3/authpb"
"go.etcd.io/etcd/api/v3/etcdserverpb"
"go.etcd.io/etcd/client/pkg/v3/fileutil"
"go.etcd.io/etcd/pkg/v3/pbutil"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/server/v3/storage/wal"
"go.uber.org/zap/zaptest"
)

func TestEtcdDumpLogEntryType(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion tools/etcd-dump-logs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ import (
"strings"
"time"

"go.uber.org/zap"

"go.etcd.io/etcd/api/v3/etcdserverpb"
"go.etcd.io/etcd/client/pkg/v3/types"
"go.etcd.io/etcd/pkg/v3/pbutil"
"go.etcd.io/etcd/raft/v3/raftpb"
"go.etcd.io/etcd/server/v3/etcdserver/api/snap"
"go.etcd.io/etcd/server/v3/storage/wal"
"go.etcd.io/etcd/server/v3/storage/wal/walpb"
"go.uber.org/zap"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions tools/proto-annotations/cmd/etcd_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"sort"

"github.com/coreos/go-semver/semver"
"go.etcd.io/etcd/server/v3/storage/wal"

"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/reflect/protoregistry"

"go.etcd.io/etcd/server/v3/storage/wal"
)

var (
Expand Down

0 comments on commit cd9764a

Please sign in to comment.