diff --git a/BUILD.bazel b/BUILD.bazel index 6d91066b8fd9a..13254b3a5d082 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,6 +14,7 @@ exports_files([ # gazelle:exclude build/linter/staticcheck # gazelle:exclude vendor # gazelle:exclude tools/patch-go +# gazelle:exclude tools/check # gazelle:resolve go github.com/bazelbuild/buildtools/build @com_github_bazelbuild_buildtools//build:go_default_library gazelle(name = "gazelle") diff --git a/tools/check/BUILD.bazel b/tools/check/BUILD.bazel new file mode 100644 index 0000000000000..9a4c65b006f39 --- /dev/null +++ b/tools/check/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ut_lib", + srcs = ["ut.go"], + importpath = "github.com/pingcap/tidb/cmd/tidb-server", + visibility = ["//visibility:private"], + deps = [ + "@org_golang_x_tools//cover:go_default_library", + "@org_uber_go_automaxprocs//maxprocs", + ], +) + +go_library( + name = "xprog_lib", + srcs = ["xprog.go"], + importpath = "github.com/pingcap/tidb/cmd/tidb-server", + visibility = ["//visibility:private"], +) diff --git a/tools/check/ut.go b/tools/check/ut.go index 8292c51c4e3c6..2a69dab6b5825 100644 --- a/tools/check/ut.go +++ b/tools/check/ut.go @@ -302,7 +302,7 @@ func cmdRun(args ...string) bool { taskCh := make(chan task, 100) works := make([]numa, p) var wg sync.WaitGroup - for range p { + for i := range p { wg.Add(1) go works[i].worker(&wg, taskCh) }