diff -urN b/benchmark/parse/BUILD.bazel c/benchmark/parse/BUILD.bazel
--- b/benchmark/parse/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/benchmark/parse/BUILD.bazel 2019-10-05 16:16:18.152331163 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["parse.go"],
+    importpath = "golang.org/x/tools/benchmark/parse",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["parse_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/blog/atom/BUILD.bazel c/blog/atom/BUILD.bazel
--- b/blog/atom/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/blog/atom/BUILD.bazel 2019-10-05 16:16:18.152331163 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["atom.go"],
+    importpath = "golang.org/x/tools/blog/atom",
+    visibility = ["//visibility:public"],
+)
diff -urN b/blog/BUILD.bazel c/blog/BUILD.bazel
--- b/blog/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/blog/BUILD.bazel 2019-10-05 16:16:18.152331163 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["blog.go"],
+    importpath = "golang.org/x/tools/blog",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//blog/atom:go_default_library",
+        "//present:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["blog_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/auth/authtest/BUILD.bazel c/cmd/auth/authtest/BUILD.bazel
--- b/cmd/auth/authtest/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/auth/authtest/BUILD.bazel 2019-10-05 16:16:18.152331163 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["authtest.go"],
+    importpath = "golang.org/x/tools/cmd/auth/authtest",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "authtest",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/auth/cookieauth/BUILD.bazel c/cmd/auth/cookieauth/BUILD.bazel
--- b/cmd/auth/cookieauth/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/auth/cookieauth/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["cookieauth.go"],
+    importpath = "golang.org/x/tools/cmd/auth/cookieauth",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "cookieauth",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/auth/gitauth/BUILD.bazel c/cmd/auth/gitauth/BUILD.bazel
--- b/cmd/auth/gitauth/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/auth/gitauth/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["gitauth.go"],
+    importpath = "golang.org/x/tools/cmd/auth/gitauth",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "gitauth",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/auth/netrcauth/BUILD.bazel c/cmd/auth/netrcauth/BUILD.bazel
--- b/cmd/auth/netrcauth/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/auth/netrcauth/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["netrcauth.go"],
+    importpath = "golang.org/x/tools/cmd/auth/netrcauth",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "netrcauth",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/benchcmp/BUILD.bazel c/cmd/benchcmp/BUILD.bazel
--- b/cmd/benchcmp/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/benchcmp/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,29 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "benchcmp.go",
+        "compare.go",
+        "doc.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/benchcmp",
+    visibility = ["//visibility:private"],
+    deps = ["//benchmark/parse:go_default_library"],
+)
+
+go_binary(
+    name = "benchcmp",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "benchcmp_test.go",
+        "compare_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = ["//benchmark/parse:go_default_library"],
+)
diff -urN b/cmd/bundle/BUILD.bazel c/cmd/bundle/BUILD.bazel
--- b/cmd/bundle/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/bundle/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,22 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/bundle",
+    visibility = ["//visibility:private"],
+    deps = ["//go/loader:go_default_library"],
+)
+
+go_binary(
+    name = "bundle",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["main_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/buildutil:go_default_library"],
+)
diff -urN b/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel c/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel
--- b/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/bundle/testdata/src/domain.name/importdecl/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["p.go"],
+    importpath = "golang.org/x/tools/cmd/bundle/testdata/src/domain.name/importdecl",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/bundle/testdata/src/initial/BUILD.bazel c/cmd/bundle/testdata/src/initial/BUILD.bazel
--- b/cmd/bundle/testdata/src/initial/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/bundle/testdata/src/initial/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "a.go",
+        "b.go",
+        "c.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/bundle/testdata/src/initial",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/callgraph/BUILD.bazel c/cmd/callgraph/BUILD.bazel
--- b/cmd/callgraph/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/callgraph/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,67 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/callgraph",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//go/callgraph:go_default_library",
+        "//go/callgraph/cha:go_default_library",
+        "//go/callgraph/rta:go_default_library",
+        "//go/callgraph/static:go_default_library",
+        "//go/packages:go_default_library",
+        "//go/pointer:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "callgraph",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["main_test.go"],
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//internal/testenv:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/cmd/callgraph/testdata/src/pkg/BUILD.bazel c/cmd/callgraph/testdata/src/pkg/BUILD.bazel
--- b/cmd/callgraph/testdata/src/pkg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/callgraph/testdata/src/pkg/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["pkg.go"],
+    importpath = "golang.org/x/tools/cmd/callgraph/testdata/src/pkg",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "pkg",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["pkg_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/compilebench/BUILD.bazel c/cmd/compilebench/BUILD.bazel
--- b/cmd/compilebench/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/compilebench/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/compilebench",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "compilebench",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/cover/BUILD.bazel c/cmd/cover/BUILD.bazel
--- b/cmd/cover/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/cover/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,62 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "cover.go",
+        "doc.go",
+        "func.go",
+        "html.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/cover",
+    visibility = ["//visibility:private"],
+    deps = ["//cover:go_default_library"],
+)
+
+go_binary(
+    name = "cover",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["cover_test.go"],
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//internal/testenv:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/cmd/cover/testdata/BUILD.bazel c/cmd/cover/testdata/BUILD.bazel
--- b/cmd/cover/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/cover/testdata/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "main.go",
+        "test.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/cover/testdata",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "testdata",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/digraph/BUILD.bazel c/cmd/digraph/BUILD.bazel
--- b/cmd/digraph/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/digraph/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["digraph.go"],
+    importpath = "golang.org/x/tools/cmd/digraph",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "digraph",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["digraph_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/eg/BUILD.bazel c/cmd/eg/BUILD.bazel
--- b/cmd/eg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/eg/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["eg.go"],
+    importpath = "golang.org/x/tools/cmd/eg",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//go/loader:go_default_library",
+        "//refactor/eg:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "eg",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/BUILD.bazel c/cmd/fiximports/BUILD.bazel
--- b/cmd/fiximports/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,56 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "fiximports",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["main_test.go"],
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//internal/testenv:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel c/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel
--- b/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/fruit.io/banana/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["banana.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/fruit.io/banana",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel c/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel
--- b/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/fruit.io/orange/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["orange.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/fruit.io/orange",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel c/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel
--- b/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/fruit.io/pear/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["pear.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/fruit.io/pear",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel c/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel
--- b/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/new.com/one/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["one.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/new.com/one",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel c/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel
--- b/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/old.com/bad/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["bad.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/old.com/bad",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel c/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel
--- b/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/old.com/one/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["one.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/old.com/one",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel c/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel
--- b/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/titanic.biz/bar/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["bar.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/titanic.biz/bar",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel c/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel
--- b/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/fiximports/testdata/src/titanic.biz/foo/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["foo.go"],
+    importpath = "golang.org/x/tools/cmd/fiximports/testdata/src/titanic.biz/foo",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/getgo/BUILD.bazel c/cmd/getgo/BUILD.bazel
--- b/cmd/getgo/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/getgo/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,32 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "download.go",
+        "main.go",
+        "path.go",
+        "steps.go",
+        "system.go",
+        "system_unix.go",
+        "system_windows.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/getgo",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "getgo",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "download_test.go",
+        "main_test.go",
+        "path_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/getgo/server/BUILD.bazel c/cmd/getgo/server/BUILD.bazel
--- b/cmd/getgo/server/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/getgo/server/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/getgo/server",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "server",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/go-contrib-init/BUILD.bazel c/cmd/go-contrib-init/BUILD.bazel
--- b/cmd/go-contrib-init/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/go-contrib-init/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["contrib.go"],
+    importpath = "golang.org/x/tools/cmd/go-contrib-init",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "go-contrib-init",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["contrib_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/godex/BUILD.bazel c/cmd/godex/BUILD.bazel
--- b/cmd/godex/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/godex/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,24 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "doc.go",
+        "gc.go",
+        "gccgo.go",
+        "godex.go",
+        "isAlias18.go",
+        "isAlias19.go",
+        "print.go",
+        "source.go",
+        "writetype.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/godex",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "godex",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/godoc/BUILD.bazel c/cmd/godoc/BUILD.bazel
--- b/cmd/godoc/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/godoc/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,47 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "blog.go",
+        "codewalk.go",
+        "dl.go",
+        "doc.go",
+        "goroot.go",
+        "handlers.go",
+        "index.go",
+        "main.go",
+        "play.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/godoc",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//blog:go_default_library",
+        "//godoc:go_default_library",
+        "//godoc/analysis:go_default_library",
+        "//godoc/golangorgenv:go_default_library",
+        "//godoc/redirect:go_default_library",
+        "//godoc/static:go_default_library",
+        "//godoc/vfs:go_default_library",
+        "//godoc/vfs/gatefs:go_default_library",
+        "//godoc/vfs/mapfs:go_default_library",
+        "//godoc/vfs/zipfs:go_default_library",
+        "//playground:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "godoc",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["godoc_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/cmd/goimports/BUILD.bazel c/cmd/goimports/BUILD.bazel
--- b/cmd/goimports/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/goimports/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "doc.go",
+        "goimports.go",
+        "goimports_gc.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/goimports",
+    visibility = ["//visibility:private"],
+    deps = ["//internal/imports:go_default_library"],
+)
+
+go_binary(
+    name = "goimports",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/gomvpkg/BUILD.bazel c/cmd/gomvpkg/BUILD.bazel
--- b/cmd/gomvpkg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/gomvpkg/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/gomvpkg",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//refactor/rename:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "gomvpkg",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/gopls/BUILD.bazel c/cmd/gopls/BUILD.bazel
--- b/cmd/gopls/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/gopls/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/gopls",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//internal/lsp/cmd:go_default_library",
+        "//internal/lsp/debug:go_default_library",
+        "//internal/tool:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "gopls",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/gorename/BUILD.bazel c/cmd/gorename/BUILD.bazel
--- b/cmd/gorename/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/gorename/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,28 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/gorename",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//refactor/rename:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "gorename",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "cgo_test.go",
+        "gorename_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = ["//internal/testenv:go_default_library"],
+)
diff -urN b/cmd/gotype/BUILD.bazel c/cmd/gotype/BUILD.bazel
--- b/cmd/gotype/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/gotype/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "gotype.go",
+        "sizesFor18.go",
+        "sizesFor19.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/gotype",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "gotype",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/goyacc/BUILD.bazel c/cmd/goyacc/BUILD.bazel
--- b/cmd/goyacc/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/goyacc/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "doc.go",
+        "yacc.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/goyacc",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "goyacc",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/goyacc/testdata/expr/BUILD.bazel c/cmd/goyacc/testdata/expr/BUILD.bazel
--- b/cmd/goyacc/testdata/expr/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/goyacc/testdata/expr/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/goyacc/testdata/expr",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "expr",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/BUILD.bazel c/cmd/guru/BUILD.bazel
--- b/cmd/guru/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,56 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "callees.go",
+        "callers.go",
+        "callstack.go",
+        "definition.go",
+        "describe.go",
+        "freevars.go",
+        "guru.go",
+        "implements.go",
+        "isAlias18.go",
+        "isAlias19.go",
+        "main.go",
+        "peers.go",
+        "pointsto.go",
+        "pos.go",
+        "referrers.go",
+        "what.go",
+        "whicherrs.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/guru",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//cmd/guru/serial:go_default_library",
+        "//go/ast/astutil:go_default_library",
+        "//go/buildutil:go_default_library",
+        "//go/callgraph:go_default_library",
+        "//go/callgraph/static:go_default_library",
+        "//go/loader:go_default_library",
+        "//go/pointer:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+        "//go/types/typeutil:go_default_library",
+        "//imports:go_default_library",
+        "//refactor/importgraph:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "guru",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "guru_test.go",
+        "unit_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = ["//internal/testenv:go_default_library"],
+)
diff -urN b/cmd/guru/serial/BUILD.bazel c/cmd/guru/serial/BUILD.bazel
--- b/cmd/guru/serial/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/serial/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["serial.go"],
+    importpath = "golang.org/x/tools/cmd/guru/serial",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/alias/BUILD.bazel c/cmd/guru/testdata/src/alias/BUILD.bazel
--- b/cmd/guru/testdata/src/alias/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/alias/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["alias.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/alias",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/calls/BUILD.bazel c/cmd/guru/testdata/src/calls/BUILD.bazel
--- b/cmd/guru/testdata/src/calls/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/calls/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/calls",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "calls",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/calls-json/BUILD.bazel c/cmd/guru/testdata/src/calls-json/BUILD.bazel
--- b/cmd/guru/testdata/src/calls-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/calls-json/BUILD.bazel 2019-10-05 16:16:18.156331073 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/calls-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "calls-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/definition-json/BUILD.bazel c/cmd/guru/testdata/src/definition-json/BUILD.bazel
--- b/cmd/guru/testdata/src/definition-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/definition-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "main.go",
+        "type.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/definition-json",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/describe/BUILD.bazel c/cmd/guru/testdata/src/describe/BUILD.bazel
--- b/cmd/guru/testdata/src/describe/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/describe/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/describe",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/describe-json/BUILD.bazel c/cmd/guru/testdata/src/describe-json/BUILD.bazel
--- b/cmd/guru/testdata/src/describe-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/describe-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/describe-json",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/freevars/BUILD.bazel c/cmd/guru/testdata/src/freevars/BUILD.bazel
--- b/cmd/guru/testdata/src/freevars/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/freevars/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/freevars",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "freevars",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/implements/BUILD.bazel c/cmd/guru/testdata/src/implements/BUILD.bazel
--- b/cmd/guru/testdata/src/implements/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/implements/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/implements",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "implements",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/implements-json/BUILD.bazel c/cmd/guru/testdata/src/implements-json/BUILD.bazel
--- b/cmd/guru/testdata/src/implements-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/implements-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/implements-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "implements-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/implements-methods/BUILD.bazel c/cmd/guru/testdata/src/implements-methods/BUILD.bazel
--- b/cmd/guru/testdata/src/implements-methods/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/implements-methods/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/implements-methods",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "implements-methods",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel c/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel
--- b/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/implements-methods-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/implements-methods-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "implements-methods-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/imports/BUILD.bazel c/cmd/guru/testdata/src/imports/BUILD.bazel
--- b/cmd/guru/testdata/src/imports/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/imports/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/imports",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "imports",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/lib/BUILD.bazel c/cmd/guru/testdata/src/lib/BUILD.bazel
--- b/cmd/guru/testdata/src/lib/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/lib/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["lib.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/lib",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/lib/sublib/BUILD.bazel c/cmd/guru/testdata/src/lib/sublib/BUILD.bazel
--- b/cmd/guru/testdata/src/lib/sublib/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/lib/sublib/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["sublib.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/lib/sublib",
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/main/BUILD.bazel c/cmd/guru/testdata/src/main/BUILD.bazel
--- b/cmd/guru/testdata/src/main/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/main/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["multi.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/main",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "main",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/peers/BUILD.bazel c/cmd/guru/testdata/src/peers/BUILD.bazel
--- b/cmd/guru/testdata/src/peers/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/peers/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/peers",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "peers",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/peers-json/BUILD.bazel c/cmd/guru/testdata/src/peers-json/BUILD.bazel
--- b/cmd/guru/testdata/src/peers-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/peers-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/peers-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "peers-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/pointsto/BUILD.bazel c/cmd/guru/testdata/src/pointsto/BUILD.bazel
--- b/cmd/guru/testdata/src/pointsto/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/pointsto/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/pointsto",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "pointsto",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/pointsto-json/BUILD.bazel c/cmd/guru/testdata/src/pointsto-json/BUILD.bazel
--- b/cmd/guru/testdata/src/pointsto-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/pointsto-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/pointsto-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "pointsto-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/referrers/BUILD.bazel c/cmd/guru/testdata/src/referrers/BUILD.bazel
--- b/cmd/guru/testdata/src/referrers/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/referrers/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/referrers",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "referrers",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "ext_test.go",
+        "int_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/guru/testdata/src/referrers-json/BUILD.bazel c/cmd/guru/testdata/src/referrers-json/BUILD.bazel
--- b/cmd/guru/testdata/src/referrers-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/referrers-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/referrers-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "referrers-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/reflection/BUILD.bazel c/cmd/guru/testdata/src/reflection/BUILD.bazel
--- b/cmd/guru/testdata/src/reflection/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/reflection/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/reflection",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "reflection",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/softerrs/BUILD.bazel c/cmd/guru/testdata/src/softerrs/BUILD.bazel
--- b/cmd/guru/testdata/src/softerrs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/softerrs/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/softerrs",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "softerrs",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/what/BUILD.bazel c/cmd/guru/testdata/src/what/BUILD.bazel
--- b/cmd/guru/testdata/src/what/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/what/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/what",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "what",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/what-json/BUILD.bazel c/cmd/guru/testdata/src/what-json/BUILD.bazel
--- b/cmd/guru/testdata/src/what-json/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/what-json/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/what-json",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "what-json",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/guru/testdata/src/whicherrs/BUILD.bazel c/cmd/guru/testdata/src/whicherrs/BUILD.bazel
--- b/cmd/guru/testdata/src/whicherrs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/guru/testdata/src/whicherrs/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/guru/testdata/src/whicherrs",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "whicherrs",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/html2article/BUILD.bazel c/cmd/html2article/BUILD.bazel
--- b/cmd/html2article/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/html2article/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["conv.go"],
+    importpath = "golang.org/x/tools/cmd/html2article",
+    visibility = ["//visibility:private"],
+    deps = [
+        "@org_golang_x_net//html:go_default_library",
+        "@org_golang_x_net//html/atom:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "html2article",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/present/BUILD.bazel c/cmd/present/BUILD.bazel
--- b/cmd/present/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/present/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,25 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "dir.go",
+        "doc.go",
+        "main.go",
+        "play.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/present",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//godoc/static:go_default_library",
+        "//playground:go_default_library",
+        "//playground/socket:go_default_library",
+        "//present:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "present",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/splitdwarf/BUILD.bazel c/cmd/splitdwarf/BUILD.bazel
--- b/cmd/splitdwarf/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/splitdwarf/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,41 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["splitdwarf.go"],
+    importpath = "golang.org/x/tools/cmd/splitdwarf",
+    visibility = ["//visibility:private"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:android": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//cmd/splitdwarf/internal/macho:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+go_binary(
+    name = "splitdwarf",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/splitdwarf/internal/macho/BUILD.bazel c/cmd/splitdwarf/internal/macho/BUILD.bazel
--- b/cmd/splitdwarf/internal/macho/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/splitdwarf/internal/macho/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "fat.go",
+        "file.go",
+        "macho.go",
+        "reloctype.go",
+        "reloctype_string.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/splitdwarf/internal/macho",
+    visibility = ["//cmd/splitdwarf:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["file_test.go"],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+)
diff -urN b/cmd/ssadump/BUILD.bazel c/cmd/ssadump/BUILD.bazel
--- b/cmd/ssadump/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/ssadump/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/cmd/ssadump",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//go/packages:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/interp:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "ssadump",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/stress/BUILD.bazel c/cmd/stress/BUILD.bazel
--- b/cmd/stress/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/stress/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["stress.go"],
+    importpath = "golang.org/x/tools/cmd/stress",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "stress",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/stringer/BUILD.bazel c/cmd/stringer/BUILD.bazel
--- b/cmd/stringer/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/stringer/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,26 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["stringer.go"],
+    importpath = "golang.org/x/tools/cmd/stringer",
+    visibility = ["//visibility:private"],
+    deps = ["//go/packages:go_default_library"],
+)
+
+go_binary(
+    name = "stringer",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "endtoend_test.go",
+        "golden_test.go",
+        "util_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = ["//internal/testenv:go_default_library"],
+)
diff -urN b/cmd/stringer/testdata/BUILD.bazel c/cmd/stringer/testdata/BUILD.bazel
--- b/cmd/stringer/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/stringer/testdata/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "cgo.go",
+        "conv.go",
+        "day.go",
+        "gap.go",
+        "num.go",
+        "number.go",
+        "prime.go",
+        "tag_main.go",
+        "unum.go",
+        "unum2.go",
+        "vary_day.go",
+    ],
+    cgo = True,
+    importpath = "golang.org/x/tools/cmd/stringer/testdata",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "testdata",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/cmd/toolstash/BUILD.bazel c/cmd/toolstash/BUILD.bazel
--- b/cmd/toolstash/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cmd/toolstash/BUILD.bazel 2019-10-05 16:16:18.160330982 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "cmp.go",
+        "main.go",
+    ],
+    importpath = "golang.org/x/tools/cmd/toolstash",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "toolstash",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/container/intsets/BUILD.bazel c/container/intsets/BUILD.bazel
--- b/container/intsets/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/container/intsets/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "popcnt_amd64.go",
+        "popcnt_amd64.s",
+        "popcnt_generic.go",
+        "sparse.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/container/intsets",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "sparse_test.go",
+        "util_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/cover/BUILD.bazel c/cover/BUILD.bazel
--- b/cover/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/cover/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["profile.go"],
+    importpath = "golang.org/x/tools/cover",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/analysistest/BUILD.bazel c/go/analysis/analysistest/BUILD.bazel
--- b/go/analysis/analysistest/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/analysistest/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,24 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["analysistest.go"],
+    importpath = "golang.org/x/tools/go/analysis/analysistest",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/internal/checker:go_default_library",
+        "//go/packages:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["analysistest_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/analysis/passes/findcall:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/analysis/BUILD.bazel c/go/analysis/BUILD.bazel
--- b/go/analysis/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "analysis.go",
+        "diagnostic.go",
+        "doc.go",
+        "validate.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/internal/analysisflags/BUILD.bazel c/go/analysis/internal/analysisflags/BUILD.bazel
--- b/go/analysis/internal/analysisflags/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/internal/analysisflags/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "flags.go",
+        "help.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/internal/analysisflags",
+    visibility = ["//go/analysis:__subpackages__"],
+    deps = ["//go/analysis:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["flags_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis:go_default_library"],
+)
diff -urN b/go/analysis/internal/checker/BUILD.bazel c/go/analysis/internal/checker/BUILD.bazel
--- b/go/analysis/internal/checker/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/internal/checker/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,26 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["checker.go"],
+    importpath = "golang.org/x/tools/go/analysis/internal/checker",
+    visibility = ["//go/analysis:__subpackages__"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/internal/analysisflags:go_default_library",
+        "//go/packages:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["checker_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/analysistest:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/analysis/internal/facts/BUILD.bazel c/go/analysis/internal/facts/BUILD.bazel
--- b/go/analysis/internal/facts/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/internal/facts/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,26 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "facts.go",
+        "imports.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/internal/facts",
+    visibility = ["//go/analysis:__subpackages__"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/types/objectpath:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["facts_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/analysis/analysistest:go_default_library",
+        "//go/packages:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/analysis/multichecker/BUILD.bazel c/go/analysis/multichecker/BUILD.bazel
--- b/go/analysis/multichecker/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/multichecker/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,25 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["multichecker.go"],
+    importpath = "golang.org/x/tools/go/analysis/multichecker",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/internal/analysisflags:go_default_library",
+        "//go/analysis/internal/checker:go_default_library",
+        "//go/analysis/unitchecker:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["multichecker_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/findcall:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/analysis/passes/asmdecl/BUILD.bazel c/go/analysis/passes/asmdecl/BUILD.bazel
--- b/go/analysis/passes/asmdecl/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/asmdecl/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["asmdecl.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/asmdecl",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["asmdecl_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel c/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/asmdecl/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "asm.go",
+        "asm1.s",
+        "asm2.s",
+        "asm3.s",
+        "asm4.s",
+        "asm5.s",
+        "asm6.s",
+        "asm7.s",
+        "asm8.s",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/asmdecl/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/assign/BUILD.bazel c/go/analysis/passes/assign/BUILD.bazel
--- b/go/analysis/passes/assign/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/assign/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["assign.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/assign",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["assign_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/assign/testdata/src/a/BUILD.bazel c/go/analysis/passes/assign/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/assign/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/assign/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/assign/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/atomic/BUILD.bazel c/go/analysis/passes/atomic/BUILD.bazel
--- b/go/analysis/passes/atomic/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/atomic/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["atomic.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomic",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["atomic_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel c/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/atomic/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomic/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/atomicalign/BUILD.bazel c/go/analysis/passes/atomicalign/BUILD.bazel
--- b/go/analysis/passes/atomicalign/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/atomicalign/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["atomicalign.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomicalign",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["atomicalign_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel c/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/atomicalign/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "a.go",
+        "stub.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomicalign/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel c/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel
--- b/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/atomicalign/testdata/src/b/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "b.go",
+        "stub.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/atomicalign/testdata/src/b",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/bools/BUILD.bazel c/go/analysis/passes/bools/BUILD.bazel
--- b/go/analysis/passes/bools/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/bools/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["bools.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/bools",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["bools_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/bools/testdata/src/a/BUILD.bazel c/go/analysis/passes/bools/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/bools/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/bools/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/bools/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/buildssa/BUILD.bazel c/go/analysis/passes/buildssa/BUILD.bazel
--- b/go/analysis/passes/buildssa/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/buildssa/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["buildssa.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/buildssa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/ssa:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["buildssa_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel c/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/buildssa/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/buildssa/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/buildtag/BUILD.bazel c/go/analysis/passes/buildtag/BUILD.bazel
--- b/go/analysis/passes/buildtag/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/buildtag/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["buildtag.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/buildtag",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["buildtag_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel c/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/buildtag/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.164330892 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["buildtag.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/buildtag/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/cgocall/BUILD.bazel c/go/analysis/passes/cgocall/BUILD.bazel
--- b/go/analysis/passes/cgocall/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/cgocall/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["cgocall.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/cgocall",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["cgocall_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/cgocall/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "cgo.go",
+        "cgo3.go",
+    ],
+    cgo = True,
+    importpath = "golang.org/x/tools/go/analysis/passes/cgocall/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel
--- b/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/cgocall/testdata/src/b/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/cgocall/testdata/src/b",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel c/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel
--- b/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/cgocall/testdata/src/c/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["c.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/cgocall/testdata/src/c",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/composite/BUILD.bazel c/go/analysis/passes/composite/BUILD.bazel
--- b/go/analysis/passes/composite/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/composite/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "composite.go",
+        "whitelist.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/composite",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["composite_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/composite/testdata/src/a/BUILD.bazel c/go/analysis/passes/composite/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/composite/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/composite/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/composite/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/copylock/BUILD.bazel c/go/analysis/passes/copylock/BUILD.bazel
--- b/go/analysis/passes/copylock/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/copylock/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["copylock.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/copylock",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["copylock_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel c/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/copylock/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "copylock.go",
+        "copylock_func.go",
+        "copylock_range.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/copylock/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/ctrlflow/BUILD.bazel c/go/analysis/passes/ctrlflow/BUILD.bazel
--- b/go/analysis/passes/ctrlflow/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/ctrlflow/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,22 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["ctrlflow.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/ctrlflow",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/cfg:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["ctrlflow_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel c/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/ctrlflow/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/ctrlflow/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel c/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel
--- b/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/ctrlflow/testdata/src/lib/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["lib.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/ctrlflow/testdata/src/lib",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/deepequalerrors/BUILD.bazel c/go/analysis/passes/deepequalerrors/BUILD.bazel
--- b/go/analysis/passes/deepequalerrors/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/deepequalerrors/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["deepequalerrors.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/deepequalerrors",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["deepequalerrors_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel c/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/deepequalerrors/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/deepequalerrors/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/errorsas/BUILD.bazel c/go/analysis/passes/errorsas/BUILD.bazel
--- b/go/analysis/passes/errorsas/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/errorsas/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["errorsas.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/errorsas",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["errorsas_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel c/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/errorsas/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/errorsas/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/findcall/BUILD.bazel c/go/analysis/passes/findcall/BUILD.bazel
--- b/go/analysis/passes/findcall/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/findcall/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["findcall.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/findcall",
+    visibility = ["//visibility:public"],
+    deps = ["//go/analysis:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["findcall_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel c/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel
--- b/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/findcall/cmd/findcall/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/findcall/cmd/findcall",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/analysis/passes/findcall:go_default_library",
+        "//go/analysis/singlechecker:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "findcall",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel c/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/findcall/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/findcall/testdata/src/a",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "a",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/httpresponse/BUILD.bazel c/go/analysis/passes/httpresponse/BUILD.bazel
--- b/go/analysis/passes/httpresponse/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/httpresponse/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["httpresponse.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/httpresponse",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["httpresponse_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel c/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/httpresponse/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/httpresponse/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/inspect/BUILD.bazel c/go/analysis/passes/inspect/BUILD.bazel
--- b/go/analysis/passes/inspect/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/inspect/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["inspect.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/inspect",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
diff -urN b/go/analysis/passes/internal/analysisutil/BUILD.bazel c/go/analysis/passes/internal/analysisutil/BUILD.bazel
--- b/go/analysis/passes/internal/analysisutil/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/internal/analysisutil/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["util.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/internal/analysisutil",
+    visibility = ["//go/analysis/passes:__subpackages__"],
+)
diff -urN b/go/analysis/passes/loopclosure/BUILD.bazel c/go/analysis/passes/loopclosure/BUILD.bazel
--- b/go/analysis/passes/loopclosure/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/loopclosure/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["loopclosure.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/loopclosure",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["loopclosure_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel c/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/loopclosure/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/loopclosure/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/lostcancel/BUILD.bazel c/go/analysis/passes/lostcancel/BUILD.bazel
--- b/go/analysis/passes/lostcancel/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/lostcancel/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,22 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["lostcancel.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/lostcancel",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/ctrlflow:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/cfg:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["lostcancel_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel c/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel
--- b/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/lostcancel/cmd/lostcancel/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/lostcancel/cmd/lostcancel",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/analysis/passes/lostcancel:go_default_library",
+        "//go/analysis/singlechecker:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "lostcancel",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel c/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/lostcancel/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/lostcancel/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel c/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel
--- b/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/lostcancel/testdata/src/b/BUILD.bazel 2019-10-05 16:16:18.168330802 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/lostcancel/testdata/src/b",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "b",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/nilfunc/BUILD.bazel c/go/analysis/passes/nilfunc/BUILD.bazel
--- b/go/analysis/passes/nilfunc/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/nilfunc/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["nilfunc.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilfunc",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["nilfunc_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel c/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/nilfunc/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilfunc/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/nilness/BUILD.bazel c/go/analysis/passes/nilness/BUILD.bazel
--- b/go/analysis/passes/nilness/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/nilness/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["nilness.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilness",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/buildssa:go_default_library",
+        "//go/ssa:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["nilness_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel c/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel
--- b/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/nilness/cmd/nilness/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/analysis/passes/nilness:go_default_library",
+        "//go/analysis/singlechecker:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "nilness",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel c/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/nilness/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/nilness/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/pkgfact/BUILD.bazel c/go/analysis/passes/pkgfact/BUILD.bazel
--- b/go/analysis/passes/pkgfact/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/pkgfact/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["pkgfact.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/pkgfact",
+    visibility = ["//visibility:public"],
+    deps = ["//go/analysis:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["pkgfact_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel c/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/pkgfact/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/pkgfact/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel c/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel
--- b/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/pkgfact/testdata/src/b/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/pkgfact/testdata/src/b",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel c/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel
--- b/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/pkgfact/testdata/src/c/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["c.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/pkgfact/testdata/src/c",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/printf/BUILD.bazel c/go/analysis/passes/printf/BUILD.bazel
--- b/go/analysis/passes/printf/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/printf/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,25 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "printf.go",
+        "types.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/printf",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["printf_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/printf/testdata/src/a/BUILD.bazel c/go/analysis/passes/printf/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/printf/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/printf/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/printf/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/printf/testdata/src/b/BUILD.bazel c/go/analysis/passes/printf/testdata/src/b/BUILD.bazel
--- b/go/analysis/passes/printf/testdata/src/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/printf/testdata/src/b/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/printf/testdata/src/b",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel c/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel
--- b/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/printf/testdata/src/nofmt/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["nofmt.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/printf/testdata/src/nofmt",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/shadow/BUILD.bazel c/go/analysis/passes/shadow/BUILD.bazel
--- b/go/analysis/passes/shadow/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/shadow/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["shadow.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/shadow",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["shadow_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel c/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel
--- b/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/shadow/cmd/shadow/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/analysis/passes/shadow:go_default_library",
+        "//go/analysis/singlechecker:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "shadow",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel c/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/shadow/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/shadow/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/shift/BUILD.bazel c/go/analysis/passes/shift/BUILD.bazel
--- b/go/analysis/passes/shift/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/shift/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,24 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "dead.go",
+        "shift.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/passes/shift",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["shift_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/shift/testdata/src/a/BUILD.bazel c/go/analysis/passes/shift/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/shift/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/shift/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/shift/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/sortslice/BUILD.bazel c/go/analysis/passes/sortslice/BUILD.bazel
--- b/go/analysis/passes/sortslice/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/sortslice/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["analyzer.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/sortslice",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["analyzer_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel c/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/sortslice/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/sortslice/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/stdmethods/BUILD.bazel c/go/analysis/passes/stdmethods/BUILD.bazel
--- b/go/analysis/passes/stdmethods/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/stdmethods/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["stdmethods.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/stdmethods",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["stdmethods_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel c/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/stdmethods/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/stdmethods/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/structtag/BUILD.bazel c/go/analysis/passes/structtag/BUILD.bazel
--- b/go/analysis/passes/structtag/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/structtag/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["structtag.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/structtag",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["structtag_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel c/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel
--- b/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/structtag/testdata/src/a/b/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/structtag/testdata/src/a/b",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel c/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/structtag/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/structtag/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/tests/BUILD.bazel c/go/analysis/passes/tests/BUILD.bazel
--- b/go/analysis/passes/tests/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/tests/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["tests.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/tests",
+    visibility = ["//visibility:public"],
+    deps = ["//go/analysis:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["tests_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/tests/testdata/src/a/BUILD.bazel c/go/analysis/passes/tests/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/tests/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/tests/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/tests/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "a_test.go",
+        "ax_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/go/analysis/passes/tests/testdata/src/b/BUILD.bazel c/go/analysis/passes/tests/testdata/src/b/BUILD.bazel
--- b/go/analysis/passes/tests/testdata/src/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/tests/testdata/src/b/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/tests/testdata/src/b",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel c/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel
--- b/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/tests/testdata/src/b_x_test/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,6 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_test")
+
+go_test(
+    name = "go_default_test",
+    srcs = ["b_test.go"],
+)
diff -urN b/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel c/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel
--- b/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/tests/testdata/src/divergent/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["buf.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/tests/testdata/src/divergent",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["buf_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/go/analysis/passes/unmarshal/BUILD.bazel c/go/analysis/passes/unmarshal/BUILD.bazel
--- b/go/analysis/passes/unmarshal/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unmarshal/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unmarshal.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unmarshal",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["unmarshal_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel c/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel
--- b/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unmarshal/cmd/unmarshal/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unmarshal/cmd/unmarshal",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/analysis/passes/unmarshal:go_default_library",
+        "//go/analysis/singlechecker:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "unmarshal",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel c/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unmarshal/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unmarshal/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/unreachable/BUILD.bazel c/go/analysis/passes/unreachable/BUILD.bazel
--- b/go/analysis/passes/unreachable/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unreachable/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unreachable.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unreachable",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["unreachable_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel c/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unreachable/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unreachable/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/unsafeptr/BUILD.bazel c/go/analysis/passes/unsafeptr/BUILD.bazel
--- b/go/analysis/passes/unsafeptr/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unsafeptr/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unsafeptr.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unsafeptr",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["unsafeptr_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel c/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unsafeptr/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unsafeptr/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/passes/unusedresult/BUILD.bazel c/go/analysis/passes/unusedresult/BUILD.bazel
--- b/go/analysis/passes/unusedresult/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unusedresult/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unusedresult.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unusedresult",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/inspect:go_default_library",
+        "//go/analysis/passes/internal/analysisutil:go_default_library",
+        "//go/ast/inspector:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["unusedresult_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//go/analysis/analysistest:go_default_library"],
+)
diff -urN b/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel c/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel
--- b/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/passes/unusedresult/testdata/src/a/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/go/analysis/passes/unusedresult/testdata/src/a",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/analysis/singlechecker/BUILD.bazel c/go/analysis/singlechecker/BUILD.bazel
--- b/go/analysis/singlechecker/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/singlechecker/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["singlechecker.go"],
+    importpath = "golang.org/x/tools/go/analysis/singlechecker",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/internal/analysisflags:go_default_library",
+        "//go/analysis/internal/checker:go_default_library",
+        "//go/analysis/unitchecker:go_default_library",
+    ],
+)
diff -urN b/go/analysis/unitchecker/BUILD.bazel c/go/analysis/unitchecker/BUILD.bazel
--- b/go/analysis/unitchecker/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/analysis/unitchecker/BUILD.bazel 2019-10-05 16:16:18.172330713 -0400
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "unitchecker.go",
+        "unitchecker112.go",
+    ],
+    importpath = "golang.org/x/tools/go/analysis/unitchecker",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/internal/analysisflags:go_default_library",
+        "//go/analysis/internal/facts:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["unitchecker_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/analysis/passes/findcall:go_default_library",
+        "//go/analysis/passes/printf:go_default_library",
+        "//go/packages/packagestest:go_default_library",
+    ],
+)
diff -urN b/go/ast/astutil/BUILD.bazel c/go/ast/astutil/BUILD.bazel
--- b/go/ast/astutil/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ast/astutil/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "enclosing.go",
+        "imports.go",
+        "rewrite.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/go/ast/astutil",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "enclosing_test.go",
+        "imports_test.go",
+        "rewrite_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/go/ast/inspector/BUILD.bazel c/go/ast/inspector/BUILD.bazel
--- b/go/ast/inspector/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ast/inspector/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "inspector.go",
+        "typeof.go",
+    ],
+    importpath = "golang.org/x/tools/go/ast/inspector",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["inspector_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/go/buildutil/BUILD.bazel c/go/buildutil/BUILD.bazel
--- b/go/buildutil/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/buildutil/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "allpackages.go",
+        "fakecontext.go",
+        "overlay.go",
+        "tags.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/go/buildutil",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "allpackages_test.go",
+        "overlay_test.go",
+        "tags_test.go",
+        "util_test.go",
+        "util_windows_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = ["//go/packages/packagestest:go_default_library"],
+)
diff -urN b/go/callgraph/BUILD.bazel c/go/callgraph/BUILD.bazel
--- b/go/callgraph/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/callgraph/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "callgraph.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/go/callgraph",
+    visibility = ["//visibility:public"],
+    deps = ["//go/ssa:go_default_library"],
+)
diff -urN b/go/callgraph/cha/BUILD.bazel c/go/callgraph/cha/BUILD.bazel
--- b/go/callgraph/cha/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/callgraph/cha/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,78 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["cha.go"],
+    importpath = "golang.org/x/tools/go/callgraph/cha",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/callgraph:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["cha_test.go"],
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/go/callgraph/cha/testdata/BUILD.bazel c/go/callgraph/cha/testdata/BUILD.bazel
--- b/go/callgraph/cha/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/callgraph/cha/testdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["issue23925.go"],
+    importpath = "golang.org/x/tools/go/callgraph/cha/testdata",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "testdata",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/callgraph/rta/BUILD.bazel c/go/callgraph/rta/BUILD.bazel
--- b/go/callgraph/rta/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/callgraph/rta/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,89 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["rta.go"],
+    importpath = "golang.org/x/tools/go/callgraph/rta",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/callgraph:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["rta_test.go"],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/callgraph:go_default_library",
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+            "//go/ssa/ssautil:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/go/callgraph/static/BUILD.bazel c/go/callgraph/static/BUILD.bazel
--- b/go/callgraph/static/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/callgraph/static/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,24 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["static.go"],
+    importpath = "golang.org/x/tools/go/callgraph/static",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/callgraph:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["static_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/callgraph:go_default_library",
+        "//go/loader:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ],
+)
diff -urN b/go/cfg/BUILD.bazel c/go/cfg/BUILD.bazel
--- b/go/cfg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/cfg/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "builder.go",
+        "cfg.go",
+    ],
+    importpath = "golang.org/x/tools/go/cfg",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["cfg_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/go/expect/BUILD.bazel c/go/expect/BUILD.bazel
--- b/go/expect/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/expect/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,17 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "expect.go",
+        "extract.go",
+    ],
+    importpath = "golang.org/x/tools/go/expect",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["expect_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/go/expect/testdata/BUILD.bazel c/go/expect/testdata/BUILD.bazel
--- b/go/expect/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/expect/testdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["test.go"],
+    importpath = "golang.org/x/tools/go/expect/testdata",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/gccgoexportdata/BUILD.bazel c/go/gccgoexportdata/BUILD.bazel
--- b/go/gccgoexportdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/gccgoexportdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["gccgoexportdata.go"],
+    importpath = "golang.org/x/tools/go/gccgoexportdata",
+    visibility = ["//visibility:public"],
+    deps = ["//go/internal/gccgoimporter:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["gccgoexportdata_test.go"],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+)
diff -urN b/go/gcexportdata/BUILD.bazel c/go/gcexportdata/BUILD.bazel
--- b/go/gcexportdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/gcexportdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,22 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "gcexportdata.go",
+        "importer.go",
+    ],
+    importpath = "golang.org/x/tools/go/gcexportdata",
+    visibility = ["//visibility:public"],
+    deps = ["//go/internal/gcimporter:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "example_test.go",
+        "gcexportdata_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+)
diff -urN b/go/internal/cgo/BUILD.bazel c/go/internal/cgo/BUILD.bazel
--- b/go/internal/cgo/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/internal/cgo/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "cgo.go",
+        "cgo_pkgconfig.go",
+    ],
+    importpath = "golang.org/x/tools/go/internal/cgo",
+    visibility = ["//go:__subpackages__"],
+)
diff -urN b/go/internal/gccgoimporter/BUILD.bazel c/go/internal/gccgoimporter/BUILD.bazel
--- b/go/internal/gccgoimporter/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/internal/gccgoimporter/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,28 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "ar.go",
+        "backdoor.go",
+        "gccgoinstallation.go",
+        "importer.go",
+        "newInterface10.go",
+        "newInterface11.go",
+        "parser.go",
+    ],
+    importpath = "golang.org/x/tools/go/internal/gccgoimporter",
+    visibility = ["//go:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "gccgoinstallation_test.go",
+        "importer_test.go",
+        "parser_test.go",
+        "testenv_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+)
diff -urN b/go/internal/gcimporter/BUILD.bazel c/go/internal/gcimporter/BUILD.bazel
--- b/go/internal/gcimporter/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/internal/gcimporter/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,34 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "bexport.go",
+        "bimport.go",
+        "exportdata.go",
+        "gcimporter.go",
+        "iexport.go",
+        "iimport.go",
+        "newInterface10.go",
+        "newInterface11.go",
+    ],
+    importpath = "golang.org/x/tools/go/internal/gcimporter",
+    visibility = ["//go:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "bexport_test.go",
+        "gcimporter11_test.go",
+        "gcimporter_test.go",
+        "iexport_test.go",
+        "israce_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//go/loader:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/internal/gcimporter/testdata/versions/BUILD.bazel c/go/internal/gcimporter/testdata/versions/BUILD.bazel
--- b/go/internal/gcimporter/testdata/versions/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/internal/gcimporter/testdata/versions/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["test.go"],
+    importpath = "golang.org/x/tools/go/internal/gcimporter/testdata/versions",
+    visibility = ["//go:__subpackages__"],
+)
diff -urN b/go/internal/packagesdriver/BUILD.bazel c/go/internal/packagesdriver/BUILD.bazel
--- b/go/internal/packagesdriver/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/internal/packagesdriver/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["sizes.go"],
+    importpath = "golang.org/x/tools/go/internal/packagesdriver",
+    visibility = ["//go:__subpackages__"],
+)
diff -urN b/go/loader/BUILD.bazel c/go/loader/BUILD.bazel
--- b/go/loader/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/loader/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,31 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "doc.go",
+        "loader.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/go/loader",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/ast/astutil:go_default_library",
+        "//go/buildutil:go_default_library",
+        "//go/internal/cgo:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "example_test.go",
+        "loader_test.go",
+        "stdlib_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/loader/testdata/BUILD.bazel c/go/loader/testdata/BUILD.bazel
--- b/go/loader/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/loader/testdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "a.go",
+        "b.go",
+        "badpkgdecl.go",
+    ],
+    importpath = "golang.org/x/tools/go/loader/testdata",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/packages/BUILD.bazel c/go/packages/BUILD.bazel
--- b/go/packages/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,37 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "doc.go",
+        "external.go",
+        "golist.go",
+        "golist_overlay.go",
+        "packages.go",
+        "visit.go",
+    ],
+    importpath = "golang.org/x/tools/go/packages",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/gcexportdata:go_default_library",
+        "//go/internal/packagesdriver:go_default_library",
+        "//internal/gopathwalk:go_default_library",
+        "//internal/semver:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "example_test.go",
+        "packages110_test.go",
+        "packages_test.go",
+        "packagescgo_test.go",
+        "stdlib_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/go/packages/gopackages/BUILD.bazel c/go/packages/gopackages/BUILD.bazel
--- b/go/packages/gopackages/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/gopackages/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/go/packages/gopackages",
+    visibility = ["//visibility:private"],
+    deps = [
+        "//go/packages:go_default_library",
+        "//go/types/typeutil:go_default_library",
+        "//internal/tool:go_default_library",
+    ],
+)
+
+go_binary(
+    name = "gopackages",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/packages/packagestest/BUILD.bazel c/go/packages/packagestest/BUILD.bazel
--- b/go/packages/packagestest/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/packagestest/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,37 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "expect.go",
+        "export.go",
+        "gopath.go",
+        "modules.go",
+        "modules_111.go",
+        "modules_112.go",
+        "modules_113.go",
+    ],
+    importpath = "golang.org/x/tools/go/packages/packagestest",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/expect:go_default_library",
+        "//go/packages:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "expect_test.go",
+        "export_test.go",
+        "gopath_test.go",
+        "modules_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/expect:go_default_library",
+        "//internal/span:go_default_library",
+    ],
+)
diff -urN b/go/packages/packagestest/testdata/BUILD.bazel c/go/packages/packagestest/testdata/BUILD.bazel
--- b/go/packages/packagestest/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/packagestest/testdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["test.go"],
+    importpath = "golang.org/x/tools/go/packages/packagestest/testdata",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.1/pkg/BUILD.bazel c/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.1/pkg/BUILD.bazel
--- b/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.1/pkg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.1/pkg/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["pkg.go"],
+    importpath = "golang.org/x/tools/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.1/pkg",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.2/pkg/BUILD.bazel c/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.2/pkg/BUILD.bazel
--- b/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.2/pkg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.2/pkg/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["pkg.go"],
+    importpath = "golang.org/x/tools/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo/v2@v2.0.2/pkg",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo@v1.0.0/pkg/BUILD.bazel c/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo@v1.0.0/pkg/BUILD.bazel
--- b/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo@v1.0.0/pkg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo@v1.0.0/pkg/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["pkg.go"],
+    importpath = "golang.org/x/tools/go/packages/testdata/TestName_ModulesDedup/pkg/mod/github.com/heschik/tools-testrepo@v1.0.0/pkg",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/pointer/BUILD.bazel c/go/pointer/BUILD.bazel
--- b/go/pointer/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/pointer/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,93 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "analysis.go",
+        "api.go",
+        "callgraph.go",
+        "constraint.go",
+        "doc.go",
+        "gen.go",
+        "hvn.go",
+        "intrinsics.go",
+        "labels.go",
+        "opt.go",
+        "print.go",
+        "query.go",
+        "reflect.go",
+        "solve.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/go/pointer",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//container/intsets:go_default_library",
+        "//go/callgraph:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "example_test.go",
+        "pointer_test.go",
+        "query_test.go",
+        "stdlib_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/callgraph:go_default_library",
+        "//go/loader:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ] + select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/buildutil:go_default_library",
+            "//go/types/typeutil:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/go/pointer/testdata/BUILD.bazel c/go/pointer/testdata/BUILD.bazel
--- b/go/pointer/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/pointer/testdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "finalizer.go",
+        "issue9002.go",
+        "rtti.go",
+    ],
+    importpath = "golang.org/x/tools/go/pointer/testdata",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "testdata",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/BUILD.bazel c/go/ssa/BUILD.bazel
--- b/go/ssa/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,101 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "blockopt.go",
+        "builder.go",
+        "const.go",
+        "create.go",
+        "doc.go",
+        "dom.go",
+        "emit.go",
+        "func.go",
+        "identical.go",
+        "identical_17.go",
+        "lift.go",
+        "lvalue.go",
+        "methods.go",
+        "mode.go",
+        "print.go",
+        "sanity.go",
+        "source.go",
+        "ssa.go",
+        "testmain.go",
+        "util.go",
+        "wrappers.go",
+    ],
+    importpath = "golang.org/x/tools/go/ssa",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/ast/astutil:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "builder_test.go",
+        "example_test.go",
+        "identical_test.go",
+        "source_test.go",
+        "stdlib_test.go",
+        "testmain_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+    deps = [
+        "//go/ast/astutil:go_default_library",
+        "//go/expect:go_default_library",
+        "//go/loader:go_default_library",
+        "//go/packages:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ] + select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/buildutil:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/go/ssa/interp/BUILD.bazel c/go/ssa/interp/BUILD.bazel
--- b/go/ssa/interp/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,30 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "external.go",
+        "interp.go",
+        "map.go",
+        "ops.go",
+        "reflect.go",
+        "value.go",
+    ],
+    importpath = "golang.org/x/tools/go/ssa/interp",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/ssa:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["interp_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/loader:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+    ],
+)
diff -urN b/go/ssa/interp/testdata/BUILD.bazel c/go/ssa/interp/testdata/BUILD.bazel
--- b/go/ssa/interp/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,29 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "boundmeth.go",
+        "complit.go",
+        "coverage.go",
+        "defer.go",
+        "fieldprom.go",
+        "ifaceconv.go",
+        "ifaceprom.go",
+        "initorder.go",
+        "methprom.go",
+        "mrvchain.go",
+        "range.go",
+        "recover.go",
+        "reflect.go",
+        "static.go",
+    ],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "testdata",
+    embed = [":go_default_library"],
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/errors/BUILD.bazel c/go/ssa/interp/testdata/src/errors/BUILD.bazel
--- b/go/ssa/interp/testdata/src/errors/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/errors/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["errors.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/errors",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/fmt/BUILD.bazel c/go/ssa/interp/testdata/src/fmt/BUILD.bazel
--- b/go/ssa/interp/testdata/src/fmt/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/fmt/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["fmt.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/fmt",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/math/BUILD.bazel c/go/ssa/interp/testdata/src/math/BUILD.bazel
--- b/go/ssa/interp/testdata/src/math/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/math/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["math.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/math",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/os/BUILD.bazel c/go/ssa/interp/testdata/src/os/BUILD.bazel
--- b/go/ssa/interp/testdata/src/os/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/os/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["os.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/os",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/reflect/BUILD.bazel c/go/ssa/interp/testdata/src/reflect/BUILD.bazel
--- b/go/ssa/interp/testdata/src/reflect/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/reflect/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["reflect.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/reflect",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/runtime/BUILD.bazel c/go/ssa/interp/testdata/src/runtime/BUILD.bazel
--- b/go/ssa/interp/testdata/src/runtime/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/runtime/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["runtime.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/runtime",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/strings/BUILD.bazel c/go/ssa/interp/testdata/src/strings/BUILD.bazel
--- b/go/ssa/interp/testdata/src/strings/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/strings/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["strings.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/strings",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/time/BUILD.bazel c/go/ssa/interp/testdata/src/time/BUILD.bazel
--- b/go/ssa/interp/testdata/src/time/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/time/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["time.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/time",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel c/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel
--- b/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/unicode/utf8/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["utf8.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/unicode/utf8",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/interp/testdata/src/unsafe/BUILD.bazel c/go/ssa/interp/testdata/src/unsafe/BUILD.bazel
--- b/go/ssa/interp/testdata/src/unsafe/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/interp/testdata/src/unsafe/BUILD.bazel 2019-10-05 16:16:18.176330623 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unsafe.go"],
+    importpath = "golang.org/x/tools/go/ssa/interp/testdata/src/unsafe",
+    visibility = ["//visibility:public"],
+)
diff -urN b/go/ssa/ssautil/BUILD.bazel c/go/ssa/ssautil/BUILD.bazel
--- b/go/ssa/ssautil/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/ssa/ssautil/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,77 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "load.go",
+        "switch.go",
+        "visit.go",
+    ],
+    importpath = "golang.org/x/tools/go/ssa/ssautil",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/loader:go_default_library",
+        "//go/packages:go_default_library",
+        "//go/ssa:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "load_test.go",
+        "switch_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages:go_default_library",
+        "//internal/testenv:go_default_library",
+    ] + select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/loader:go_default_library",
+            "//go/ssa:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/go/types/objectpath/BUILD.bazel c/go/types/objectpath/BUILD.bazel
--- b/go/types/objectpath/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/types/objectpath/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["objectpath.go"],
+    importpath = "golang.org/x/tools/go/types/objectpath",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["objectpath_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//go/gcexportdata:go_default_library",
+        "//go/loader:go_default_library",
+    ],
+)
diff -urN b/go/types/typeutil/BUILD.bazel c/go/types/typeutil/BUILD.bazel
--- b/go/types/typeutil/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/types/typeutil/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "callee.go",
+        "imports.go",
+        "map.go",
+        "methodsetcache.go",
+        "ui.go",
+    ],
+    importpath = "golang.org/x/tools/go/types/typeutil",
+    visibility = ["//visibility:public"],
+    deps = ["//go/ast/astutil:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "callee_test.go",
+        "example_test.go",
+        "imports_test.go",
+        "map_test.go",
+        "ui_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/go/vcs/BUILD.bazel c/go/vcs/BUILD.bazel
--- b/go/vcs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/go/vcs/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "discovery.go",
+        "env.go",
+        "http.go",
+        "vcs.go",
+    ],
+    importpath = "golang.org/x/tools/go/vcs",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["vcs_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/godoc/analysis/BUILD.bazel c/godoc/analysis/BUILD.bazel
--- b/godoc/analysis/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/analysis/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "analysis.go",
+        "callgraph.go",
+        "implements.go",
+        "json.go",
+        "peers.go",
+        "typeinfo.go",
+    ],
+    importpath = "golang.org/x/tools/godoc/analysis",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/callgraph:go_default_library",
+        "//go/loader:go_default_library",
+        "//go/pointer:go_default_library",
+        "//go/ssa:go_default_library",
+        "//go/ssa/ssautil:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
diff -urN b/godoc/BUILD.bazel c/godoc/BUILD.bazel
--- b/godoc/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,53 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "corpus.go",
+        "dirtrees.go",
+        "format.go",
+        "godoc.go",
+        "index.go",
+        "linkify.go",
+        "meta.go",
+        "page.go",
+        "parser.go",
+        "pres.go",
+        "search.go",
+        "server.go",
+        "snippet.go",
+        "spec.go",
+        "spot.go",
+        "tab.go",
+        "template.go",
+        "versions.go",
+    ],
+    importpath = "golang.org/x/tools/godoc",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//godoc/analysis:go_default_library",
+        "//godoc/golangorgenv:go_default_library",
+        "//godoc/util:go_default_library",
+        "//godoc/vfs:go_default_library",
+        "//godoc/vfs/httpfs:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "dirtrees_test.go",
+        "godoc17_test.go",
+        "godoc_test.go",
+        "index_test.go",
+        "server_test.go",
+        "spec_test.go",
+        "versions_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//godoc/vfs:go_default_library",
+        "//godoc/vfs/gatefs:go_default_library",
+        "//godoc/vfs/mapfs:go_default_library",
+    ],
+)
diff -urN b/godoc/golangorgenv/BUILD.bazel c/godoc/golangorgenv/BUILD.bazel
--- b/godoc/golangorgenv/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/golangorgenv/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["golangorgenv.go"],
+    importpath = "golang.org/x/tools/godoc/golangorgenv",
+    visibility = ["//visibility:public"],
+)
diff -urN b/godoc/redirect/BUILD.bazel c/godoc/redirect/BUILD.bazel
--- b/godoc/redirect/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/redirect/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "hash.go",
+        "redirect.go",
+        "rietveld.go",
+    ],
+    importpath = "golang.org/x/tools/godoc/redirect",
+    visibility = ["//visibility:public"],
+    deps = ["@org_golang_x_net//context/ctxhttp:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["redirect_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/godoc/static/BUILD.bazel c/godoc/static/BUILD.bazel
--- b/godoc/static/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/static/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "doc.go",
+        "gen.go",
+        "static.go",
+    ],
+    importpath = "golang.org/x/tools/godoc/static",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["gen_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/godoc/util/BUILD.bazel c/godoc/util/BUILD.bazel
--- b/godoc/util/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/util/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "throttle.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/godoc/util",
+    visibility = ["//visibility:public"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
diff -urN b/godoc/vfs/BUILD.bazel c/godoc/vfs/BUILD.bazel
--- b/godoc/vfs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/vfs/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "emptyvfs.go",
+        "namespace.go",
+        "os.go",
+        "vfs.go",
+    ],
+    importpath = "golang.org/x/tools/godoc/vfs",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "namespace_test.go",
+        "os_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = ["//godoc/vfs/mapfs:go_default_library"],
+)
diff -urN b/godoc/vfs/gatefs/BUILD.bazel c/godoc/vfs/gatefs/BUILD.bazel
--- b/godoc/vfs/gatefs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/vfs/gatefs/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["gatefs.go"],
+    importpath = "golang.org/x/tools/godoc/vfs/gatefs",
+    visibility = ["//visibility:public"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["gatefs_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
diff -urN b/godoc/vfs/httpfs/BUILD.bazel c/godoc/vfs/httpfs/BUILD.bazel
--- b/godoc/vfs/httpfs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/vfs/httpfs/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,9 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["httpfs.go"],
+    importpath = "golang.org/x/tools/godoc/vfs/httpfs",
+    visibility = ["//visibility:public"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
diff -urN b/godoc/vfs/mapfs/BUILD.bazel c/godoc/vfs/mapfs/BUILD.bazel
--- b/godoc/vfs/mapfs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/vfs/mapfs/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,15 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["mapfs.go"],
+    importpath = "golang.org/x/tools/godoc/vfs/mapfs",
+    visibility = ["//visibility:public"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["mapfs_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/godoc/vfs/zipfs/BUILD.bazel c/godoc/vfs/zipfs/BUILD.bazel
--- b/godoc/vfs/zipfs/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/godoc/vfs/zipfs/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["zipfs.go"],
+    importpath = "golang.org/x/tools/godoc/vfs/zipfs",
+    visibility = ["//visibility:public"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["zipfs_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//godoc/vfs:go_default_library"],
+)
diff -urN b/imports/BUILD.bazel c/imports/BUILD.bazel
--- b/imports/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/imports/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,9 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["forward.go"],
+    importpath = "golang.org/x/tools/imports",
+    visibility = ["//visibility:public"],
+    deps = ["//internal/imports:go_default_library"],
+)
diff -urN b/internal/apidiff/BUILD.bazel c/internal/apidiff/BUILD.bazel
--- b/internal/apidiff/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/apidiff/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,24 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "apidiff.go",
+        "compatibility.go",
+        "correspondence.go",
+        "messageset.go",
+        "report.go",
+    ],
+    importpath = "golang.org/x/tools/internal/apidiff",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["apidiff_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/internal/apidiff/testdata/BUILD.bazel c/internal/apidiff/testdata/BUILD.bazel
--- b/internal/apidiff/testdata/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/apidiff/testdata/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["tests.go"],
+    importpath = "golang.org/x/tools/internal/apidiff/testdata",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/apidiff/testdata/exported_fields/BUILD.bazel c/internal/apidiff/testdata/exported_fields/BUILD.bazel
--- b/internal/apidiff/testdata/exported_fields/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/apidiff/testdata/exported_fields/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["ef.go"],
+    importpath = "golang.org/x/tools/internal/apidiff/testdata/exported_fields",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/fastwalk/BUILD.bazel c/internal/fastwalk/BUILD.bazel
--- b/internal/fastwalk/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/fastwalk/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,22 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "fastwalk.go",
+        "fastwalk_dirent_fileno.go",
+        "fastwalk_dirent_ino.go",
+        "fastwalk_dirent_namlen_bsd.go",
+        "fastwalk_dirent_namlen_linux.go",
+        "fastwalk_portable.go",
+        "fastwalk_unix.go",
+    ],
+    importpath = "golang.org/x/tools/internal/fastwalk",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["fastwalk_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/gopathwalk/BUILD.bazel c/internal/gopathwalk/BUILD.bazel
--- b/internal/gopathwalk/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/gopathwalk/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,15 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["walk.go"],
+    importpath = "golang.org/x/tools/internal/gopathwalk",
+    visibility = ["//:__subpackages__"],
+    deps = ["//internal/fastwalk:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["walk_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/imports/BUILD.bazel c/internal/imports/BUILD.bazel
--- b/internal/imports/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/imports/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,42 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "fix.go",
+        "imports.go",
+        "mod.go",
+        "mod_cache.go",
+        "sortimports.go",
+        "zstdlib.go",
+    ],
+    importpath = "golang.org/x/tools/internal/imports",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//go/ast/astutil:go_default_library",
+        "//go/packages:go_default_library",
+        "//internal/gopathwalk:go_default_library",
+        "//internal/module:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "fix_test.go",
+        "imports_test.go",
+        "mod_112_test.go",
+        "mod_cache_test.go",
+        "mod_test.go",
+        "proxy_112_test.go",
+        "proxy_113_test.go",
+    ],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/module:go_default_library",
+        "//internal/testenv:go_default_library",
+        "//internal/txtar:go_default_library",
+    ],
+)
diff -urN b/internal/jsonrpc2/BUILD.bazel c/internal/jsonrpc2/BUILD.bazel
--- b/internal/jsonrpc2/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/jsonrpc2/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "handler.go",
+        "jsonrpc2.go",
+        "stream.go",
+        "wire.go",
+    ],
+    importpath = "golang.org/x/tools/internal/jsonrpc2",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["jsonrpc2_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/lsp/browser/BUILD.bazel c/internal/lsp/browser/BUILD.bazel
--- b/internal/lsp/browser/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/browser/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["browser.go"],
+    importpath = "golang.org/x/tools/internal/lsp/browser",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/BUILD.bazel c/internal/lsp/BUILD.bazel
--- b/internal/lsp/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,60 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "code_action.go",
+        "command.go",
+        "completion.go",
+        "definition.go",
+        "diagnostics.go",
+        "folding_range.go",
+        "format.go",
+        "general.go",
+        "highlight.go",
+        "hover.go",
+        "link.go",
+        "references.go",
+        "rename.go",
+        "server.go",
+        "signature_help.go",
+        "symbols.go",
+        "text_synchronization.go",
+        "watched_files.go",
+        "workspace.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/imports:go_default_library",
+        "//internal/jsonrpc2:go_default_library",
+        "//internal/lsp/debug:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/source:go_default_library",
+        "//internal/lsp/telemetry:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/telemetry/log:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+        "//internal/telemetry/trace:go_default_library",
+        "@org_golang_x_xerrors//:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "completion_test.go",
+        "lsp_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/lsp/cache:go_default_library",
+        "//internal/lsp/diff:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/source:go_default_library",
+        "//internal/lsp/tests:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/cache/BUILD.bazel c/internal/lsp/cache/BUILD.bazel
--- b/internal/lsp/cache/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/cache/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,62 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "analysis.go",
+        "builtin.go",
+        "cache.go",
+        "check.go",
+        "external.go",
+        "file.go",
+        "gofile.go",
+        "load.go",
+        "parse.go",
+        "pkg.go",
+        "session.go",
+        "snapshot.go",
+        "view.go",
+        "watcher.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/cache",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/analysis/passes/asmdecl:go_default_library",
+        "//go/analysis/passes/assign:go_default_library",
+        "//go/analysis/passes/atomic:go_default_library",
+        "//go/analysis/passes/atomicalign:go_default_library",
+        "//go/analysis/passes/bools:go_default_library",
+        "//go/analysis/passes/buildtag:go_default_library",
+        "//go/analysis/passes/cgocall:go_default_library",
+        "//go/analysis/passes/composite:go_default_library",
+        "//go/analysis/passes/copylock:go_default_library",
+        "//go/analysis/passes/httpresponse:go_default_library",
+        "//go/analysis/passes/loopclosure:go_default_library",
+        "//go/analysis/passes/lostcancel:go_default_library",
+        "//go/analysis/passes/nilfunc:go_default_library",
+        "//go/analysis/passes/printf:go_default_library",
+        "//go/analysis/passes/shift:go_default_library",
+        "//go/analysis/passes/sortslice:go_default_library",
+        "//go/analysis/passes/stdmethods:go_default_library",
+        "//go/analysis/passes/structtag:go_default_library",
+        "//go/analysis/passes/tests:go_default_library",
+        "//go/analysis/passes/unmarshal:go_default_library",
+        "//go/analysis/passes/unreachable:go_default_library",
+        "//go/analysis/passes/unsafeptr:go_default_library",
+        "//go/analysis/passes/unusedresult:go_default_library",
+        "//go/packages:go_default_library",
+        "//internal/imports:go_default_library",
+        "//internal/lsp/debug:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/source:go_default_library",
+        "//internal/lsp/telemetry:go_default_library",
+        "//internal/memoize:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/telemetry/log:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+        "//internal/telemetry/trace:go_default_library",
+        "//internal/xcontext:go_default_library",
+        "@org_golang_x_xerrors//:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/cmd/BUILD.bazel c/internal/lsp/cmd/BUILD.bazel
--- b/internal/lsp/cmd/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/cmd/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,52 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "check.go",
+        "cmd.go",
+        "definition.go",
+        "format.go",
+        "info.go",
+        "query.go",
+        "rename.go",
+        "serve.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/cmd",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//cmd/guru/serial:go_default_library",
+        "//internal/jsonrpc2:go_default_library",
+        "//internal/lsp:go_default_library",
+        "//internal/lsp/browser:go_default_library",
+        "//internal/lsp/cache:go_default_library",
+        "//internal/lsp/debug:go_default_library",
+        "//internal/lsp/diff:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/source:go_default_library",
+        "//internal/lsp/telemetry:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/export/ocagent:go_default_library",
+        "//internal/telemetry/trace:go_default_library",
+        "//internal/tool:go_default_library",
+        "//internal/xcontext:go_default_library",
+        "@org_golang_x_xerrors//:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "cmd_test.go",
+        "export_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/lsp/cmd/test:go_default_library",
+        "//internal/lsp/tests:go_default_library",
+        "//internal/testenv:go_default_library",
+        "//internal/tool:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/cmd/test/BUILD.bazel c/internal/lsp/cmd/test/BUILD.bazel
--- b/internal/lsp/cmd/test/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/cmd/test/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "check.go",
+        "cmdtest.go",
+        "definition.go",
+        "format.go",
+        "rename.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/cmd/test",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/lsp/cmd:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/source:go_default_library",
+        "//internal/lsp/tests:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/tool:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/debug/BUILD.bazel c/internal/lsp/debug/BUILD.bazel
--- b/internal/lsp/debug/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/debug/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,26 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "info.1.11.go",
+        "info.1.12.go",
+        "info.go",
+        "metrics.go",
+        "rpc.go",
+        "serve.go",
+        "trace.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/debug",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/lsp/telemetry:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/export/prometheus:go_default_library",
+        "//internal/telemetry/log:go_default_library",
+        "//internal/telemetry/metric:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/diff/BUILD.bazel c/internal/lsp/diff/BUILD.bazel
--- b/internal/lsp/diff/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/diff/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "diff.go",
+        "unified.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/diff",
+    visibility = ["//:__subpackages__"],
+    deps = ["//internal/span:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["diff_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//internal/span:go_default_library"],
+)
diff -urN b/internal/lsp/diff/difftest/BUILD.bazel c/internal/lsp/diff/difftest/BUILD.bazel
--- b/internal/lsp/diff/difftest/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/diff/difftest/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["difftest.go"],
+    importpath = "golang.org/x/tools/internal/lsp/diff/difftest",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/lsp/diff:go_default_library",
+        "//internal/span:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/diff/myers/BUILD.bazel c/internal/lsp/diff/myers/BUILD.bazel
--- b/internal/lsp/diff/myers/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/diff/myers/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["diff.go"],
+    importpath = "golang.org/x/tools/internal/lsp/diff/myers",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/lsp/diff:go_default_library",
+        "//internal/span:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["diff_test.go"],
+    embed = [":go_default_library"],
+    deps = ["//internal/lsp/diff/difftest:go_default_library"],
+)
diff -urN b/internal/lsp/fuzzy/BUILD.bazel c/internal/lsp/fuzzy/BUILD.bazel
--- b/internal/lsp/fuzzy/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/fuzzy/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "input.go",
+        "matcher.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/fuzzy",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "input_test.go",
+        "matcher_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/lsp/protocol/BUILD.bazel c/internal/lsp/protocol/BUILD.bazel
--- b/internal/lsp/protocol/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/protocol/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,28 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "context.go",
+        "doc.go",
+        "enums.go",
+        "log.go",
+        "protocol.go",
+        "span.go",
+        "tsclient.go",
+        "tsprotocol.go",
+        "tsserver.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/protocol",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/jsonrpc2:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/log:go_default_library",
+        "//internal/telemetry/trace:go_default_library",
+        "//internal/xcontext:go_default_library",
+        "@org_golang_x_xerrors//:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/snippet/BUILD.bazel c/internal/lsp/snippet/BUILD.bazel
--- b/internal/lsp/snippet/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/snippet/BUILD.bazel 2019-10-05 16:16:18.180330533 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["snippet_builder.go"],
+    importpath = "golang.org/x/tools/internal/lsp/snippet",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["snippet_builder_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/lsp/source/BUILD.bazel c/internal/lsp/source/BUILD.bazel
--- b/internal/lsp/source/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/source/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,76 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "analysis.go",
+        "comment.go",
+        "completion.go",
+        "completion_format.go",
+        "completion_literal.go",
+        "completion_snippet.go",
+        "deep_completion.go",
+        "diagnostics.go",
+        "errors.go",
+        "folding_range.go",
+        "format.go",
+        "highlight.go",
+        "hover.go",
+        "identifier.go",
+        "imports.go",
+        "options.go",
+        "references.go",
+        "rename.go",
+        "rename_check.go",
+        "signature_help.go",
+        "suggested_fix.go",
+        "symbols.go",
+        "tidy.go",
+        "util.go",
+        "view.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/source",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//go/analysis:go_default_library",
+        "//go/ast/astutil:go_default_library",
+        "//go/packages:go_default_library",
+        "//go/types/typeutil:go_default_library",
+        "//internal/imports:go_default_library",
+        "//internal/lsp/diff:go_default_library",
+        "//internal/lsp/diff/myers:go_default_library",
+        "//internal/lsp/fuzzy:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/snippet:go_default_library",
+        "//internal/lsp/telemetry:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/telemetry/log:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+        "//internal/telemetry/trace:go_default_library",
+        "//refactor/satisfy:go_default_library",
+        "@org_golang_x_sync//errgroup:go_default_library",
+        "@org_golang_x_xerrors//:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "comment_test.go",
+        "diagnostics_test.go",
+        "imports_test.go",
+        "source_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/packages/packagestest:go_default_library",
+        "//internal/lsp/cache:go_default_library",
+        "//internal/lsp/diff:go_default_library",
+        "//internal/lsp/fuzzy:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/tests:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/testenv:go_default_library",
+        "@org_golang_x_xerrors//:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/telemetry/BUILD.bazel c/internal/lsp/telemetry/BUILD.bazel
--- b/internal/lsp/telemetry/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/telemetry/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["telemetry.go"],
+    importpath = "golang.org/x/tools/internal/lsp/telemetry",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry/stats:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+        "//internal/telemetry/unit:go_default_library",
+    ],
+)
diff -urN b/internal/lsp/testdata/analyzer/BUILD.bazel c/internal/lsp/testdata/analyzer/BUILD.bazel
--- b/internal/lsp/testdata/analyzer/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/analyzer/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,6 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_test")
+
+go_test(
+    name = "go_default_test",
+    srcs = ["bad_test.go"],
+)
diff -urN b/internal/lsp/testdata/bad/BUILD.bazel c/internal/lsp/testdata/bad/BUILD.bazel
--- b/internal/lsp/testdata/bad/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/bad/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "bad0.go",
+        "bad1.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/bad",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/basiclit/BUILD.bazel c/internal/lsp/testdata/basiclit/BUILD.bazel
--- b/internal/lsp/testdata/basiclit/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/basiclit/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["basiclit.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/basiclit",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/builtins/BUILD.bazel c/internal/lsp/testdata/builtins/BUILD.bazel
--- b/internal/lsp/testdata/builtins/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/builtins/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "builtins.go",
+        "iota.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/builtins",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/casesensitive/BUILD.bazel c/internal/lsp/testdata/casesensitive/BUILD.bazel
--- b/internal/lsp/testdata/casesensitive/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/casesensitive/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["casesensitive.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/casesensitive",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/channel/BUILD.bazel c/internal/lsp/testdata/channel/BUILD.bazel
--- b/internal/lsp/testdata/channel/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/channel/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["channel.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/channel",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/comments/BUILD.bazel c/internal/lsp/testdata/comments/BUILD.bazel
--- b/internal/lsp/testdata/comments/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/comments/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["comments.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/comments",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/constant/BUILD.bazel c/internal/lsp/testdata/constant/BUILD.bazel
--- b/internal/lsp/testdata/constant/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/constant/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["constant.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/constant",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/deep/BUILD.bazel c/internal/lsp/testdata/deep/BUILD.bazel
--- b/internal/lsp/testdata/deep/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/deep/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["deep.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/deep",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/errors/BUILD.bazel c/internal/lsp/testdata/errors/BUILD.bazel
--- b/internal/lsp/testdata/errors/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/errors/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["errors.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/errors",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/fieldlist/BUILD.bazel c/internal/lsp/testdata/fieldlist/BUILD.bazel
--- b/internal/lsp/testdata/fieldlist/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/fieldlist/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["field_list.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/fieldlist",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/folding/BUILD.bazel c/internal/lsp/testdata/folding/BUILD.bazel
--- b/internal/lsp/testdata/folding/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/folding/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["a.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/folding",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/foo/BUILD.bazel c/internal/lsp/testdata/foo/BUILD.bazel
--- b/internal/lsp/testdata/foo/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/foo/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["foo.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/foo",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/format/BUILD.bazel c/internal/lsp/testdata/format/BUILD.bazel
--- b/internal/lsp/testdata/format/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/format/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["good_format.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/format",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/funcsig/BUILD.bazel c/internal/lsp/testdata/funcsig/BUILD.bazel
--- b/internal/lsp/testdata/funcsig/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/funcsig/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["func_sig.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/funcsig",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/funcvalue/BUILD.bazel c/internal/lsp/testdata/funcvalue/BUILD.bazel
--- b/internal/lsp/testdata/funcvalue/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/funcvalue/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["func_value.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/funcvalue",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/fuzzy/BUILD.bazel c/internal/lsp/testdata/fuzzy/BUILD.bazel
--- b/internal/lsp/testdata/fuzzy/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/fuzzy/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["fuzzy.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/fuzzy",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/generated/BUILD.bazel c/internal/lsp/testdata/generated/BUILD.bazel
--- b/internal/lsp/testdata/generated/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/generated/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "generated.go",
+        "generator.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/generated",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/godef/a/BUILD.bazel c/internal/lsp/testdata/godef/a/BUILD.bazel
--- b/internal/lsp/testdata/godef/a/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/godef/a/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "a.go",
+        "d.go",
+        "f.go",
+        "random.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/godef/a",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/godef/b/BUILD.bazel c/internal/lsp/testdata/godef/b/BUILD.bazel
--- b/internal/lsp/testdata/godef/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/godef/b/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "b.go",
+        "c.go",
+        "e.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/godef/b",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/good/BUILD.bazel c/internal/lsp/testdata/good/BUILD.bazel
--- b/internal/lsp/testdata/good/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/good/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "good0.go",
+        "good1.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/good",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/highlights/BUILD.bazel c/internal/lsp/testdata/highlights/BUILD.bazel
--- b/internal/lsp/testdata/highlights/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/highlights/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["highlights.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/highlights",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/importedcomplit/BUILD.bazel c/internal/lsp/testdata/importedcomplit/BUILD.bazel
--- b/internal/lsp/testdata/importedcomplit/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/importedcomplit/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["imported_complit.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/importedcomplit",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/imports/BUILD.bazel c/internal/lsp/testdata/imports/BUILD.bazel
--- b/internal/lsp/testdata/imports/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/imports/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "good_imports.go",
+        "needs_imports.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/imports",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/index/BUILD.bazel c/internal/lsp/testdata/index/BUILD.bazel
--- b/internal/lsp/testdata/index/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/index/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["index.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/index",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/interfacerank/BUILD.bazel c/internal/lsp/testdata/interfacerank/BUILD.bazel
--- b/internal/lsp/testdata/interfacerank/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/interfacerank/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["interface_rank.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/interfacerank",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/links/BUILD.bazel c/internal/lsp/testdata/links/BUILD.bazel
--- b/internal/lsp/testdata/links/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/links/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["links.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/links",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/nodisk/BUILD.bazel c/internal/lsp/testdata/nodisk/BUILD.bazel
--- b/internal/lsp/testdata/nodisk/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/nodisk/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["nodisk.overlay.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/nodisk",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/references/BUILD.bazel c/internal/lsp/testdata/references/BUILD.bazel
--- b/internal/lsp/testdata/references/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/references/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["refs.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/references",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/rename/b/BUILD.bazel c/internal/lsp/testdata/rename/b/BUILD.bazel
--- b/internal/lsp/testdata/rename/b/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/rename/b/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["b.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/rename/b",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/rename/testy/BUILD.bazel c/internal/lsp/testdata/rename/testy/BUILD.bazel
--- b/internal/lsp/testdata/rename/testy/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/rename/testy/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["testy.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/rename/testy",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["testy_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/lsp/testdata/signature/BUILD.bazel c/internal/lsp/testdata/signature/BUILD.bazel
--- b/internal/lsp/testdata/signature/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/signature/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["signature.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/signature",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/snippets/BUILD.bazel c/internal/lsp/testdata/snippets/BUILD.bazel
--- b/internal/lsp/testdata/snippets/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/snippets/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["literal_snippets.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/snippets",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/suggestedfix/BUILD.bazel c/internal/lsp/testdata/suggestedfix/BUILD.bazel
--- b/internal/lsp/testdata/suggestedfix/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/suggestedfix/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["has_suggested_fix.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/suggestedfix",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/symbols/BUILD.bazel c/internal/lsp/testdata/symbols/BUILD.bazel
--- b/internal/lsp/testdata/symbols/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/symbols/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["main.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/symbols",
+    visibility = ["//visibility:private"],
+)
+
+go_binary(
+    name = "symbols",
+    embed = [":go_default_library"],
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/testy/BUILD.bazel c/internal/lsp/testdata/testy/BUILD.bazel
--- b/internal/lsp/testdata/testy/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/testy/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["testy.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/testy",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["testy_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/lsp/testdata/typeassert/BUILD.bazel c/internal/lsp/testdata/typeassert/BUILD.bazel
--- b/internal/lsp/testdata/typeassert/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/typeassert/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["type_assert.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/typeassert",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/types/BUILD.bazel c/internal/lsp/testdata/types/BUILD.bazel
--- b/internal/lsp/testdata/types/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/types/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["types.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/types",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/unimported/BUILD.bazel c/internal/lsp/testdata/unimported/BUILD.bazel
--- b/internal/lsp/testdata/unimported/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/unimported/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unimported.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/unimported",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/testdata/unsafe/BUILD.bazel c/internal/lsp/testdata/unsafe/BUILD.bazel
--- b/internal/lsp/testdata/unsafe/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/testdata/unsafe/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unsafe.go"],
+    importpath = "golang.org/x/tools/internal/lsp/testdata/unsafe",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/lsp/tests/BUILD.bazel c/internal/lsp/tests/BUILD.bazel
--- b/internal/lsp/tests/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/lsp/tests/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,21 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "completion.go",
+        "diagnostics.go",
+        "tests.go",
+    ],
+    importpath = "golang.org/x/tools/internal/lsp/tests",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//go/expect:go_default_library",
+        "//go/packages:go_default_library",
+        "//go/packages/packagestest:go_default_library",
+        "//internal/lsp/protocol:go_default_library",
+        "//internal/lsp/source:go_default_library",
+        "//internal/span:go_default_library",
+        "//internal/txtar:go_default_library",
+    ],
+)
diff -urN b/internal/memoize/BUILD.bazel c/internal/memoize/BUILD.bazel
--- b/internal/memoize/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/memoize/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,18 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "memoize.go",
+        "nocopy.go",
+    ],
+    importpath = "golang.org/x/tools/internal/memoize",
+    visibility = ["//:__subpackages__"],
+    deps = ["//internal/xcontext:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["memoize_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/module/BUILD.bazel c/internal/module/BUILD.bazel
--- b/internal/module/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/module/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,15 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["module.go"],
+    importpath = "golang.org/x/tools/internal/module",
+    visibility = ["//:__subpackages__"],
+    deps = ["//internal/semver:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["module_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/semver/BUILD.bazel c/internal/semver/BUILD.bazel
--- b/internal/semver/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/semver/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["semver.go"],
+    importpath = "golang.org/x/tools/internal/semver",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["semver_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/span/BUILD.bazel c/internal/span/BUILD.bazel
--- b/internal/span/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/span/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,27 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "parse.go",
+        "span.go",
+        "token.go",
+        "token111.go",
+        "token112.go",
+        "uri.go",
+        "utf16.go",
+    ],
+    importpath = "golang.org/x/tools/internal/span",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "span_test.go",
+        "token_test.go",
+        "uri_test.go",
+        "utf16_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/telemetry/BUILD.bazel c/internal/telemetry/BUILD.bazel
--- b/internal/telemetry/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,16 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "context.go",
+        "doc.go",
+        "event.go",
+        "id.go",
+        "metric.go",
+        "tag.go",
+        "trace.go",
+    ],
+    importpath = "golang.org/x/tools/internal/telemetry",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/telemetry/export/BUILD.bazel c/internal/telemetry/export/BUILD.bazel
--- b/internal/telemetry/export/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/export/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "export.go",
+        "log.go",
+        "multi.go",
+        "null.go",
+    ],
+    importpath = "golang.org/x/tools/internal/telemetry/export",
+    visibility = ["//:__subpackages__"],
+    deps = ["//internal/telemetry:go_default_library"],
+)
diff -urN b/internal/telemetry/export/ocagent/BUILD.bazel c/internal/telemetry/export/ocagent/BUILD.bazel
--- b/internal/telemetry/export/ocagent/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/export/ocagent/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,25 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["ocagent.go"],
+    importpath = "golang.org/x/tools/internal/telemetry/export/ocagent",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/export/ocagent/wire:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["ocagent_test.go"],
+    embed = [":go_default_library"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export/ocagent/wire:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+    ],
+)
diff -urN b/internal/telemetry/export/ocagent/wire/BUILD.bazel c/internal/telemetry/export/ocagent/wire/BUILD.bazel
--- b/internal/telemetry/export/ocagent/wire/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/export/ocagent/wire/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "common.go",
+        "core.go",
+        "metrics.go",
+        "trace.go",
+    ],
+    importpath = "golang.org/x/tools/internal/telemetry/export/ocagent/wire",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/telemetry/export/prometheus/BUILD.bazel c/internal/telemetry/export/prometheus/BUILD.bazel
--- b/internal/telemetry/export/prometheus/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/export/prometheus/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["prometheus.go"],
+    importpath = "golang.org/x/tools/internal/telemetry/export/prometheus",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/metric:go_default_library",
+    ],
+)
diff -urN b/internal/telemetry/log/BUILD.bazel c/internal/telemetry/log/BUILD.bazel
--- b/internal/telemetry/log/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/log/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["log.go"],
+    importpath = "golang.org/x/tools/internal/telemetry/log",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+    ],
+)
diff -urN b/internal/telemetry/metric/BUILD.bazel c/internal/telemetry/metric/BUILD.bazel
--- b/internal/telemetry/metric/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/metric/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["metric.go"],
+    importpath = "golang.org/x/tools/internal/telemetry/metric",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/stats:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+    ],
+)
diff -urN b/internal/telemetry/stats/BUILD.bazel c/internal/telemetry/stats/BUILD.bazel
--- b/internal/telemetry/stats/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/stats/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "stats.go",
+        "worker.go",
+    ],
+    importpath = "golang.org/x/tools/internal/telemetry/stats",
+    visibility = ["//:__subpackages__"],
+    deps = ["//internal/telemetry/unit:go_default_library"],
+)
diff -urN b/internal/telemetry/tag/BUILD.bazel c/internal/telemetry/tag/BUILD.bazel
--- b/internal/telemetry/tag/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/tag/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,15 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "key.go",
+        "tag.go",
+    ],
+    importpath = "golang.org/x/tools/internal/telemetry/tag",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+    ],
+)
diff -urN b/internal/telemetry/trace/BUILD.bazel c/internal/telemetry/trace/BUILD.bazel
--- b/internal/telemetry/trace/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/trace/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,13 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["trace.go"],
+    importpath = "golang.org/x/tools/internal/telemetry/trace",
+    visibility = ["//:__subpackages__"],
+    deps = [
+        "//internal/telemetry:go_default_library",
+        "//internal/telemetry/export:go_default_library",
+        "//internal/telemetry/tag:go_default_library",
+    ],
+)
diff -urN b/internal/telemetry/unit/BUILD.bazel c/internal/telemetry/unit/BUILD.bazel
--- b/internal/telemetry/unit/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/telemetry/unit/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["unit.go"],
+    importpath = "golang.org/x/tools/internal/telemetry/unit",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/testenv/BUILD.bazel c/internal/testenv/BUILD.bazel
--- b/internal/testenv/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/testenv/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,11 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "testenv.go",
+        "testenv_112.go",
+    ],
+    importpath = "golang.org/x/tools/internal/testenv",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/tool/BUILD.bazel c/internal/tool/BUILD.bazel
--- b/internal/tool/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/tool/BUILD.bazel 2019-10-05 16:16:18.184330442 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["tool.go"],
+    importpath = "golang.org/x/tools/internal/tool",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/internal/txtar/BUILD.bazel c/internal/txtar/BUILD.bazel
--- b/internal/txtar/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/txtar/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["archive.go"],
+    importpath = "golang.org/x/tools/internal/txtar",
+    visibility = ["//:__subpackages__"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["archive_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/internal/xcontext/BUILD.bazel c/internal/xcontext/BUILD.bazel
--- b/internal/xcontext/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/internal/xcontext/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,8 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["xcontext.go"],
+    importpath = "golang.org/x/tools/internal/xcontext",
+    visibility = ["//:__subpackages__"],
+)
diff -urN b/playground/BUILD.bazel c/playground/BUILD.bazel
--- b/playground/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/playground/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,9 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["playground.go"],
+    importpath = "golang.org/x/tools/playground",
+    visibility = ["//visibility:public"],
+    deps = ["//godoc/golangorgenv:go_default_library"],
+)
diff -urN b/playground/socket/BUILD.bazel c/playground/socket/BUILD.bazel
--- b/playground/socket/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/playground/socket/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,15 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["socket.go"],
+    importpath = "golang.org/x/tools/playground/socket",
+    visibility = ["//visibility:public"],
+    deps = ["@org_golang_x_net//websocket:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["socket_test.go"],
+    embed = [":go_default_library"],
+)
diff -urN b/present/BUILD.bazel c/present/BUILD.bazel
--- b/present/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/present/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,30 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "args.go",
+        "caption.go",
+        "code.go",
+        "doc.go",
+        "html.go",
+        "iframe.go",
+        "image.go",
+        "link.go",
+        "parse.go",
+        "style.go",
+        "video.go",
+    ],
+    importpath = "golang.org/x/tools/present",
+    visibility = ["//visibility:public"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "code_test.go",
+        "link_test.go",
+        "style_test.go",
+    ],
+    embed = [":go_default_library"],
+)
diff -urN b/refactor/eg/BUILD.bazel c/refactor/eg/BUILD.bazel
--- b/refactor/eg/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/refactor/eg/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,67 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "eg.go",
+        "match.go",
+        "rewrite.go",
+    ],
+    importpath = "golang.org/x/tools/refactor/eg",
+    visibility = ["//visibility:public"],
+    deps = ["//go/ast/astutil:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["eg_test.go"],
+    data = glob(["testdata/**"]),
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/loader:go_default_library",
+            "//internal/testenv:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/refactor/importgraph/BUILD.bazel c/refactor/importgraph/BUILD.bazel
--- b/refactor/importgraph/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/refactor/importgraph/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,51 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["graph.go"],
+    importpath = "golang.org/x/tools/refactor/importgraph",
+    visibility = ["//visibility:public"],
+    deps = ["//go/buildutil:go_default_library"],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = ["graph_test.go"],
+    embed = [":go_default_library"],
+    deps = select({
+        "@io_bazel_rules_go//go/platform:darwin": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:dragonfly": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:freebsd": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:ios": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:linux": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:nacl": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:netbsd": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:openbsd": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:plan9": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:solaris": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "@io_bazel_rules_go//go/platform:windows": [
+            "//go/packages/packagestest:go_default_library",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff -urN b/refactor/rename/BUILD.bazel c/refactor/rename/BUILD.bazel
--- b/refactor/rename/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/refactor/rename/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,35 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+    name = "go_default_library",
+    srcs = [
+        "check.go",
+        "mvpkg.go",
+        "rename.go",
+        "spec.go",
+        "util.go",
+    ],
+    importpath = "golang.org/x/tools/refactor/rename",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/ast/astutil:go_default_library",
+        "//go/buildutil:go_default_library",
+        "//go/loader:go_default_library",
+        "//go/types/typeutil:go_default_library",
+        "//refactor/importgraph:go_default_library",
+        "//refactor/satisfy:go_default_library",
+    ],
+)
+
+go_test(
+    name = "go_default_test",
+    srcs = [
+        "mvpkg_test.go",
+        "rename_test.go",
+    ],
+    embed = [":go_default_library"],
+    deps = [
+        "//go/buildutil:go_default_library",
+        "//internal/testenv:go_default_library",
+    ],
+)
diff -urN b/refactor/satisfy/BUILD.bazel c/refactor/satisfy/BUILD.bazel
--- b/refactor/satisfy/BUILD.bazel 1969-12-31 19:00:00.000000000 -0500
+++ c/refactor/satisfy/BUILD.bazel 2019-10-05 16:16:18.188330352 -0400
@@ -0,0 +1,12 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+    name = "go_default_library",
+    srcs = ["find.go"],
+    importpath = "golang.org/x/tools/refactor/satisfy",
+    visibility = ["//visibility:public"],
+    deps = [
+        "//go/ast/astutil:go_default_library",
+        "//go/types/typeutil:go_default_library",
+    ],
+)
