Upgrade repository to Go 1.18.
Steps taken:
1. Ran `bazel build //infra/bots/...` and had the following errors:
compilepkg: missing strict dependencies:
/private/var/tmp/.../sandbox/darwin-sandbox/781/execroot/skia/infra/bots/task_drivers/
codesize/codesize_test.go: import of "github.com/stretchr/testify/mock"
/private/var/tmp/.../sandbox/darwin-sandbox/781/execroot/skia/infra/bots/task_drivers/
codesize/codesize_test.go: import of "go.skia.org/infra/go/util"
2. Added missing dependencies to infra/bots/task_drivers/codesize/BUILD.bazel
which is included in this commit.
3. Ran `bazel build //infra/bots/...` - success.
4. Ran `go mod tidy` which resulted in no changes.
5. Ran `make -C bazel gazelle_update_repo` which resulted in no changes.
6. Ran `bazel build modules/canvaskit/go/...` - success.
Bug: skia:13605
Change-Id: Id8aa9a7d26f8849a7e602445c2b84c2586f589e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/564923
Commit-Queue: Chris Mumford <cmumford@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel
index 6b4c4bb..f4a8ac8 100644
--- a/WORKSPACE.bazel
+++ b/WORKSPACE.bazel
@@ -117,7 +117,7 @@
go_rules_dependencies()
-go_register_toolchains(version = "1.17.2")
+go_register_toolchains(version = "1.18")
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE.bazel")
diff --git a/infra/bots/task_drivers/codesize/BUILD.bazel b/infra/bots/task_drivers/codesize/BUILD.bazel
index 92d40a8..e504d48 100644
--- a/infra/bots/task_drivers/codesize/BUILD.bazel
+++ b/infra/bots/task_drivers/codesize/BUILD.bazel
@@ -40,6 +40,7 @@
embed = [":codesize_lib"],
deps = [
"@com_github_stretchr_testify//assert",
+ "@com_github_stretchr_testify//mock",
"@com_github_stretchr_testify//require",
"@org_skia_go_infra//go/exec",
"@org_skia_go_infra//go/gcs",
@@ -53,6 +54,7 @@
"@org_skia_go_infra//go/mockhttpclient",
"@org_skia_go_infra//go/now",
"@org_skia_go_infra//go/testutils",
+ "@org_skia_go_infra//go/util",
"@org_skia_go_infra//task_driver/go/td",
"@org_skia_go_infra//task_scheduler/go/types",
],