dashboard: set GOPROXY=off for the "go" repo to catch more network usage

Updates golang/go#30612
Updates golang/go#30760

Change-Id: I296f4f7a163c1bdd59e839229c0961b21f26da89
Reviewed-on: https://go-review.googlesource.com/c/build/+/167039
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index 2ac11e8..49540f3 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -749,6 +749,10 @@
 		env = append(env, "GO_BUILDER_SET_GOPROXY=coordinator")
 	}
 	switch repo {
+	case "go":
+		if !c.OutboundNetworkAllowed() {
+			env = append(env, "GOPROXY=off")
+		}
 	case "oauth2", "build", "website":
 		env = append(env, "GO111MODULE=on")
 	}
@@ -844,6 +848,13 @@
 	return strings.HasSuffix(c.Name, "-longtest")
 }
 
+// OutboundNetworkAllowed reports whether this builder should be
+// allowed to make outbound network requests. This is only enforced
+// on some builders. (Currently most Linux ones)
+func (c *BuildConfig) OutboundNetworkAllowed() bool {
+	return c.Name == "misc-vet-vetall" || c.IsLongTest()
+}
+
 func (c *BuildConfig) GoInstallRacePackages() []string {
 	if c.InstallRacePackages != nil {
 		return append([]string(nil), c.InstallRacePackages...)