diff --git a/executor/analyze_test.go b/executor/analyze_test.go index 6750aea652950..7ea9c0996526d 100644 --- a/executor/analyze_test.go +++ b/executor/analyze_test.go @@ -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") diff --git a/executor/distsql_test.go b/executor/distsql_test.go index 6f06fd550f0b4..847d1aa2a9e15 100644 --- a/executor/distsql_test.go +++ b/executor/distsql_test.go @@ -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") diff --git a/executor/memory_test.go b/executor/memory_test.go index c2599f3ee4d70..c02f0f5bca4b6 100644 --- a/executor/memory_test.go +++ b/executor/memory_test.go @@ -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 diff --git a/planner/core/prepare_test.go b/planner/core/prepare_test.go index 274bba763fd58..b8bcbaa588bb1 100644 --- a/planner/core/prepare_test.go +++ b/planner/core/prepare_test.go @@ -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) diff --git a/statistics/handle/handle_test.go b/statistics/handle/handle_test.go index 36b39b8c0f46f..ab00916ad1b11 100644 --- a/statistics/handle/handle_test.go +++ b/statistics/handle/handle_test.go @@ -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 diff --git a/structure/type.go b/structure/type.go index 77b3b04a4869a..8470ff245b416 100644 --- a/structure/type.go +++ b/structure/type.go @@ -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...)