*: Fixed some linter check errors (#25608)

This commit is contained in:
Qiannan
2021-06-26 14:05:23 +12:00
committed by GitHub
parent 9e8bb505e1
commit a9daa4a006
6 changed files with 9 additions and 0 deletions

View File

@ -606,6 +606,7 @@ func (s *testSuite1) TestAnalyzeIncrementalStreaming(c *C) {
s.testAnalyzeIncremental(tk, c)
}
// nolint:unused
func (s *testSuite1) testAnalyzeIncremental(tk *testkit.TestKit, c *C) {
tk.MustExec("use test")
tk.MustExec("drop table if exists t")

View File

@ -36,6 +36,7 @@ import (
"github.com/pingcap/tidb/util/testkit"
)
// nolint:unused
func checkGoroutineExists(keyword string) bool {
buf := new(bytes.Buffer)
profile := pprof.Lookup("goroutine")

View File

@ -104,12 +104,14 @@ func (s *testMemoryLeak) TestPBMemoryLeak(c *C) {
c.Assert(s.memDiff(inUseFinal, inUseAfter), Less, delta)
}
// nolint:unused
func (s *testMemoryLeak) readMem() (allocated, heapInUse uint64) {
var stat runtime.MemStats
runtime.ReadMemStats(&stat)
return stat.TotalAlloc, stat.HeapInuse
}
// nolint:unused
func (s *testMemoryLeak) memDiff(m1, m2 uint64) uint64 {
if m1 > m2 {
return m1 - m2

View File

@ -345,6 +345,7 @@ func (s *testPrepareSerialSuite) TestPrepareTableAsNameOnGroupByWithCache(c *C)
tk.MustQuery("execute stmt").Sort().Check(testkit.Rows("partner1", "partner2", "partner3", "partner4"))
}
// nolint:unused
func readGaugeInt(g prometheus.Gauge) int {
ch := make(chan prometheus.Metric, 1)
g.Collect(ch)

View File

@ -847,6 +847,7 @@ func (s *testStatsSuite) TestBuildGlobalLevelStats(c *C) {
c.Assert(len(result.Rows()), Equals, 20)
}
// nolint:unused
func (s *testStatsSuite) prepareForGlobalStatsWithOpts(c *C, tk *testkit.TestKit, tblName, dbName string) {
tk.MustExec("create database if not exists " + dbName)
tk.MustExec("use " + dbName)
@ -870,6 +871,7 @@ func (s *testStatsSuite) prepareForGlobalStatsWithOpts(c *C, tk *testkit.TestKit
c.Assert(s.do.StatsHandle().DumpStatsDeltaToKV(handle.DumpAll), IsNil)
}
// nolint:unused
func (s *testStatsSuite) checkForGlobalStatsWithOpts(c *C, tk *testkit.TestKit, p string, topn, buckets int) {
delta := buckets/2 + 1
for _, isIdx := range []int{0, 1} {
@ -890,6 +892,7 @@ func (s *testStatsSuite) TestAnalyzeGlobalStatsWithOpts(c *C) {
tk := testkit.NewTestKit(c, s.store)
s.prepareForGlobalStatsWithOpts(c, tk, "test_gstats_opt", "test_gstats_opt")
// nolint:unused
type opt struct {
topn int
buckets int

View File

@ -51,6 +51,7 @@ func (t *TxStructure) encodeStringDataKey(key []byte) kv.Key {
return codec.EncodeUint(ek, uint64(StringData))
}
// nolint:unused
func (t *TxStructure) encodeHashMetaKey(key []byte) kv.Key {
ek := make([]byte, 0, len(t.prefix)+codec.EncodedBytesLength(len(key))+8)
ek = append(ek, t.prefix...)