Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: guo-shaoge <[email protected]>
  • Loading branch information
guo-shaoge committed May 17, 2021
1 parent c45b41d commit 923734b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions util/checksum/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ package checksum

import (
"encoding/binary"
"errors"
"hash/crc32"
"io"
"sync"

"github.com/pingcap/errors"
)

const (
Expand Down
7 changes: 5 additions & 2 deletions util/chunk/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ func testReaderWithCache(c *check.C) {
// It means only new reader is alloced after writing.
oriReader := l.r
for i := 0; i < 100; i++ {
row, _ = l.GetRow(RowPtr{0, 0})
row, err = l.GetRow(RowPtr{0, 0})
c.Assert(err, check.IsNil)
c.Assert(oriReader == l.r, check.IsTrue)
c.Assert(l.isReaderStale, check.IsFalse)
}
Expand All @@ -345,12 +346,14 @@ func testReaderWithCache(c *check.C) {

// New reader is generated when reading.
row, err = l.GetRow(RowPtr{1, 0})
c.Assert(err, check.IsNil)
c.Assert(oriReader != l.r, check.IsTrue)
c.Assert(l.isReaderStale, check.IsFalse)
oriReader = l.r

for i := 0; i < 100; i++ {
row, _ = l.GetRow(RowPtr{0, 0})
row, err = l.GetRow(RowPtr{0, 0})
c.Assert(err, check.IsNil)
c.Assert(oriReader == l.r, check.IsTrue)
c.Assert(l.isReaderStale, check.IsFalse)
}
Expand Down

0 comments on commit 923734b

Please sign in to comment.