Skip to content

Commit

Permalink
*: upgrade staticcheck (pingcap#36745)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Aug 1, 2022
1 parent e7ee7e2 commit 1fe666a
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 15 deletions.
4 changes: 2 additions & 2 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def go_deps():
build_file_proto_mode = "disable_global",
importpath = "honnef.co/go/tools",
replace = "honnef.co/go/tools",
sum = "h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34=",
version = "v0.3.2",
sum = "h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=",
version = "v0.3.3",
)
go_repository(
name = "com_4d63_gochecknoglobals",
Expand Down
1 change: 1 addition & 0 deletions br/pkg/backup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ go_library(
deps = [
"//br/pkg/checksum",
"//br/pkg/conn",
"//br/pkg/conn/util",
"//br/pkg/errors",
"//br/pkg/glue",
"//br/pkg/logutil",
Expand Down
3 changes: 2 additions & 1 deletion br/pkg/conn/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ go_library(
importpath = "github.com/pingcap/tidb/br/pkg/conn",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/conn/util",
"//br/pkg/errors",
"//br/pkg/glue",
"//br/pkg/logutil",
Expand All @@ -14,7 +15,6 @@ go_library(
"//br/pkg/version",
"//domain",
"//kv",
"//util/engine",
"@com_github_docker_go_units//:go-units",
"@com_github_opentracing_opentracing_go//:opentracing-go",
"@com_github_pingcap_errors//:errors",
Expand Down Expand Up @@ -44,6 +44,7 @@ go_test(
embed = [":conn"],
flaky = True,
deps = [
"//br/pkg/conn/util",
"//br/pkg/pdutil",
"//br/pkg/utils",
"//testkit/testsetup",
Expand Down
15 changes: 15 additions & 0 deletions br/pkg/conn/util/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "util",
srcs = ["util.go"],
importpath = "github.com/pingcap/tidb/br/pkg/conn/util",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/errors",
"//util/engine",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_tikv_pd_client//:client",
],
)
2 changes: 2 additions & 0 deletions br/pkg/lightning/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ go_library(
"//br/pkg/storage",
"//br/pkg/utils",
"//br/pkg/version/build",
"//expression",
"//planner/core",
"//util/promutil",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
Expand Down
5 changes: 1 addition & 4 deletions br/pkg/lightning/backend/kv/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ go_library(
"//meta/autoid",
"//parser/model",
"//parser/mysql",
"//planner/core",
"//sessionctx",
"//sessionctx/variable",
"//table",
Expand All @@ -49,10 +48,9 @@ go_test(
"session_test.go",
"sql2kv_test.go",
],
embed = [":kv"],
flaky = True,
deps = [
"//br/pkg/lightning/backend/kv",
":kv",
"//br/pkg/lightning/common",
"//br/pkg/lightning/log",
"//br/pkg/lightning/verification",
Expand All @@ -74,4 +72,3 @@ go_test(
"@org_uber_go_zap//zapcore",
],
)

4 changes: 2 additions & 2 deletions br/pkg/lightning/backend/local/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ go_library(
"//br/pkg/logutil",
"//br/pkg/membuf",
"//br/pkg/pdutil",
"//br/pkg/restore",
"//br/pkg/restore/split",
"//br/pkg/utils",
"//br/pkg/version",
"//distsql",
Expand Down Expand Up @@ -100,7 +100,7 @@ go_test(
"//br/pkg/membuf",
"//br/pkg/mock",
"//br/pkg/pdutil",
"//br/pkg/restore",
"//br/pkg/restore/split",
"//br/pkg/utils",
"//kv",
"//parser/mysql",
Expand Down
8 changes: 5 additions & 3 deletions br/pkg/restore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ go_library(
"rawkv_client.go",
"search.go",
"split.go",
"split_client.go",
"stream_metas.go",
"systable_restore.go",
"util.go",
Expand All @@ -25,13 +24,14 @@ go_library(
"//br/pkg/backup",
"//br/pkg/checksum",
"//br/pkg/conn",
"//br/pkg/conn/util",
"//br/pkg/errors",
"//br/pkg/glue",
"//br/pkg/httputil",
"//br/pkg/logutil",
"//br/pkg/metautil",
"//br/pkg/pdutil",
"//br/pkg/redact",
"//br/pkg/restore/split",
"//br/pkg/rtree",
"//br/pkg/storage",
"//br/pkg/stream",
Expand Down Expand Up @@ -64,7 +64,6 @@ go_library(
"@com_github_pingcap_kvproto//pkg/kvrpcpb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_kvproto//pkg/pdpb",
"@com_github_pingcap_kvproto//pkg/tikvpb",
"@com_github_pingcap_log//:log",
"@com_github_tikv_client_go_v2//config",
"@com_github_tikv_client_go_v2//kv",
Expand Down Expand Up @@ -92,6 +91,7 @@ go_test(
"client_test.go",
"db_test.go",
"import_retry_test.go",
"log_client_test.go",
"main_test.go",
"merge_fuzz_test.go",
"merge_test.go",
Expand All @@ -113,6 +113,7 @@ go_test(
"//br/pkg/logutil",
"//br/pkg/metautil",
"//br/pkg/mock",
"//br/pkg/restore/split",
"//br/pkg/rtree",
"//br/pkg/storage",
"//br/pkg/stream",
Expand Down Expand Up @@ -152,5 +153,6 @@ go_test(
"@org_uber_go_goleak//:goleak",
"@org_uber_go_multierr//:multierr",
"@org_uber_go_zap//:zap",
"@org_uber_go_zap//zapcore",
],
)
36 changes: 36 additions & 0 deletions br/pkg/restore/split/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "split",
srcs = [
"client.go",
"region.go",
"split.go",
],
importpath = "github.com/pingcap/tidb/br/pkg/restore/split",
visibility = ["//visibility:public"],
deps = [
"//br/pkg/conn/util",
"//br/pkg/errors",
"//br/pkg/httputil",
"//br/pkg/logutil",
"//br/pkg/redact",
"//br/pkg/utils",
"//store/pdtypes",
"@com_github_pingcap_errors//:errors",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_pingcap_kvproto//pkg/errorpb",
"@com_github_pingcap_kvproto//pkg/kvrpcpb",
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_kvproto//pkg/pdpb",
"@com_github_pingcap_kvproto//pkg/tikvpb",
"@com_github_pingcap_log//:log",
"@com_github_tikv_pd_client//:client",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials",
"@org_golang_google_grpc//status",
"@org_uber_go_multierr//:multierr",
"@org_uber_go_zap//:zap",
],
)
1 change: 1 addition & 0 deletions br/pkg/task/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go_library(
"//br/pkg/backup",
"//br/pkg/checksum",
"//br/pkg/conn",
"//br/pkg/conn/util",
"//br/pkg/errors",
"//br/pkg/glue",
"//br/pkg/httputil",
Expand Down
1 change: 1 addition & 0 deletions ddl/failtest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_test(
deps = [
"//config",
"//ddl",
"//ddl/schematracker",
"//ddl/testutil",
"//ddl/util",
"//domain",
Expand Down
4 changes: 4 additions & 0 deletions ddl/schematracker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ go_library(
"//parser/ast",
"//parser/charset",
"//parser/model",
"//parser/mysql",
"//parser/types",
"//sessionctx",
"//sessionctx/variable",
"//statistics/handle",
Expand All @@ -42,7 +44,9 @@ go_test(
embed = [":schematracker"],
flaky = True,
deps = [
"//executor",
"//infoschema",
"//meta/autoid",
"//parser",
"//parser/ast",
"//parser/model",
Expand Down
1 change: 1 addition & 0 deletions distsql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ go_test(
"//util/mathutil",
"//util/memory",
"//util/mock",
"//util/paging",
"//util/ranger",
"@com_github_pingcap_tipb//go-tipb",
"@com_github_stretchr_testify//require",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@ replace github.com/pingcap/tidb/parser => ./parser
// fix potential security issue(CVE-2020-26160) introduced by indirect dependency.
replace github.com/dgrijalva/jwt-go => github.com/form3tech-oss/jwt-go v3.2.6-0.20210809144907-32ab6a8243d7+incompatible

replace honnef.co/go/tools => honnef.co/go/tools v0.3.2
replace honnef.co/go/tools => honnef.co/go/tools v0.3.3
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1581,8 +1581,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.3.2 h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34=
honnef.co/go/tools v0.3.2/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw=
honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw=
k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s=
Expand Down
1 change: 1 addition & 0 deletions session/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ go_library(
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_client_go_v2//txnkv/transaction",
"@com_github_tikv_client_go_v2//util",
"@io_etcd_go_etcd_client_v3//concurrency",
"@org_uber_go_zap//:zap",
],
)
Expand Down

0 comments on commit 1fe666a

Please sign in to comment.