diff --git a/WORKSPACE b/WORKSPACE index ca2888449c5a7..7a28e83bfd4fd 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -37,12 +37,12 @@ versions.check(minimum_bazel_version = "6.0.0") http_archive( name = "io_bazel_rules_go", - sha256 = "67b4d1f517ba73e0a92eb2f57d821f2ddc21f5bc2bd7a231573f11bd8758192e", + sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8", urls = [ - "http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.50.0/rules_go-v0.50.0.zip", - "http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.50.0/rules_go-v0.50.0.zip", - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.0/rules_go-v0.50.0.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.50.0/rules_go-v0.50.0.zip", + "http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", + "http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", ], ) diff --git a/pkg/ddl/backfilling_test.go b/pkg/ddl/backfilling_test.go index f4ed3e9859b29..109e9d9d7b434 100644 --- a/pkg/ddl/backfilling_test.go +++ b/pkg/ddl/backfilling_test.go @@ -179,6 +179,7 @@ func assertStaticExprContextEqual(t *testing.T, sctx sessionctx.Context, exprCtx tm, err := ctx.CurrentTime() require.Equal(t, ctx.Location().String(), tm.Location().String()) require.InDelta(t, tm1.Unix(), tm.Unix(), 2) + require.NoError(t, err) }, }, { diff --git a/pkg/executor/join/join_row_table_test.go b/pkg/executor/join/join_row_table_test.go index 2b11d9af3053e..b7aa5656b1405 100644 --- a/pkg/executor/join/join_row_table_test.go +++ b/pkg/executor/join/join_row_table_test.go @@ -44,4 +44,4 @@ func TestBitMaskInUint32(t *testing.T) { func TestUintptrCanHoldPointer(t *testing.T) { require.Equal(t, true, sizeOfUintptr >= sizeOfUnsafePointer) -} \ No newline at end of file +} diff --git a/pkg/planner/core/casetest/instanceplancache/dml_test.go b/pkg/planner/core/casetest/instanceplancache/dml_test.go index 04549783d5701..c145b45ddf02e 100644 --- a/pkg/planner/core/casetest/instanceplancache/dml_test.go +++ b/pkg/planner/core/casetest/instanceplancache/dml_test.go @@ -223,14 +223,14 @@ func TestInstancePlanCacheDMLBasic(t *testing.T) { insert = fmt.Sprintf("insert into t2 values (%d, %d, %d)", a, b, c) return } - randDelete := func() (prep, set, exec, delete string) { + randDelete := func() (prep, set, exec, del string) { a := rand.Intn(100) b := rand.Intn(100) c := rand.Intn(100) prep = `prepare stmt from 'delete from t1 where a < ? and b < ? or c < ?'` set = fmt.Sprintf("set @a = %d, @b = %d, @c = %d", a, b, c) exec = `execute stmt using @a, @b, @c` - delete = fmt.Sprintf("delete from t2 where a < %d and b < %d or c < %d", a, b, c) + del = fmt.Sprintf("delete from t2 where a < %d and b < %d or c < %d", a, b, c) return } randUpdate := func() (prep, set, exec, update string) { diff --git a/pkg/planner/indexadvisor/indexadvisor_test.go b/pkg/planner/indexadvisor/indexadvisor_test.go index 58f6ac195132e..c3fadc56f8e51 100644 --- a/pkg/planner/indexadvisor/indexadvisor_test.go +++ b/pkg/planner/indexadvisor/indexadvisor_test.go @@ -52,7 +52,7 @@ func check(ctx context.Context, t *testing.T, tk *testkit.TestKit, return } - var indexes []string + indexes := make([]string, 0, len(r)) for _, result := range r { indexes = append(indexes, fmt.Sprintf("%v.%v.%v", result.Database, result.Table, strings.Join(result.IndexColumns, "_"))) } diff --git a/pkg/util/collate/unicode_0400_ci_generated.go b/pkg/util/collate/unicode_0400_ci_generated.go index c073d4c67aad7..db1ac70e218e9 100644 --- a/pkg/util/collate/unicode_0400_ci_generated.go +++ b/pkg/util/collate/unicode_0400_ci_generated.go @@ -25,7 +25,7 @@ type unicodeCICollator struct { // Clone implements Collator interface. func (uc *unicodeCICollator) Clone() Collator { - return &unicodeCICollator{impl: uc.impl.Clone()} + return &unicodeCICollator{impl: uc.impl.Clone()} } // Compare implements Collator interface. diff --git a/pkg/util/collate/unicode_0900_ai_ci_generated.go b/pkg/util/collate/unicode_0900_ai_ci_generated.go index 5e160c6182231..51177f893ca9c 100644 --- a/pkg/util/collate/unicode_0900_ai_ci_generated.go +++ b/pkg/util/collate/unicode_0900_ai_ci_generated.go @@ -25,7 +25,7 @@ type unicode0900AICICollator struct { // Clone implements Collator interface. func (uc *unicode0900AICICollator) Clone() Collator { - return &unicode0900AICICollator{impl: uc.impl.Clone()} + return &unicode0900AICICollator{impl: uc.impl.Clone()} } // Compare implements Collator interface. diff --git a/tools/check/check-gogenerate.sh b/tools/check/check-gogenerate.sh index 9acbed85dcfcd..1ee4e778d50dd 100755 --- a/tools/check/check-gogenerate.sh +++ b/tools/check/check-gogenerate.sh @@ -17,6 +17,7 @@ set -euo pipefail go generate ./... pushd pkg/parser && make generate && popd +go fmt ./... set +e diffline=$(git status -s | awk '{print $2}' | xargs grep '^// Code generated .* DO NOT EDIT\.$' 2>/dev/null) set -e