Skip to content

Commit

Permalink
*: clean code (pingcap#31903)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Jan 23, 2022
1 parent 701f126 commit 5055177
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion br/pkg/lightning/common/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"net/http/httptest"
"time"

sqlmock "github.com/DATA-DOG/go-sqlmock"
"github.com/DATA-DOG/go-sqlmock"
. "github.com/pingcap/check"
"github.com/pingcap/errors"
"github.com/pingcap/tidb/br/pkg/lightning/common"
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/summary/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type LogCollector interface {

type logFunc func(msg string, fields ...zap.Field)

var collector LogCollector = NewLogCollector(log.Info)
var collector = NewLogCollector(log.Info)

// InitCollector initilize global collector instance.
func InitCollector( // revive:disable-line:flag-parameter
Expand Down
2 changes: 1 addition & 1 deletion sessionctx/binloginfo/binloginfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/codec"
"github.com/pingcap/tidb/util/collate"
binlog "github.com/pingcap/tipb/go-binlog"
"github.com/pingcap/tipb/go-binlog"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
)
Expand Down
2 changes: 1 addition & 1 deletion store/mockstore/unistore/cophandler/topn.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/pingcap/tidb/sessionctx/stmtctx"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/collate"
tipb "github.com/pingcap/tipb/go-tipb"
"github.com/pingcap/tipb/go-tipb"
)

type sortRow struct {
Expand Down
2 changes: 1 addition & 1 deletion table/tables/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util"
"github.com/pingcap/tidb/util/testutil"
binlog "github.com/pingcap/tipb/go-binlog"
"github.com/pingcap/tipb/go-binlog"
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
)
Expand Down
4 changes: 2 additions & 2 deletions util/checksum/checksum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func assertUnderlyingWrite(t *testing.T, encrypt bool, f io.WriteCloser, fc func
}

func underlyingReadAt(f io.ReaderAt, encrypt bool, ctrCipher *encrypt2.CtrCipher, n, off int) error {
var underlying io.ReaderAt = f
var underlying = f
if encrypt {
underlying = encrypt2.NewReader(underlying, ctrCipher)
}
Expand All @@ -492,7 +492,7 @@ func underlyingReadAt(f io.ReaderAt, encrypt bool, ctrCipher *encrypt2.CtrCipher

func assertReadAtFunc(t *testing.T, encrypt bool, ctrCipher *encrypt2.CtrCipher) func(off int64, r []byte, assertErr error, assertN int, assertString string, f io.ReaderAt) {
return func(off int64, r []byte, assertErr error, assertN int, assertString string, f io.ReaderAt) {
var underlying io.ReaderAt = f
var underlying = f
if encrypt {
underlying = encrypt2.NewReader(underlying, ctrCipher)
}
Expand Down
2 changes: 1 addition & 1 deletion util/tracing/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"testing"

basictracer "github.com/opentracing/basictracer-go"
"github.com/opentracing/basictracer-go"
"github.com/opentracing/opentracing-go"
"github.com/pingcap/tidb/util/tracing"
"github.com/stretchr/testify/require"
Expand Down

0 comments on commit 5055177

Please sign in to comment.