dashboard: inline loong64 dist test and build repo policy functions

Having dedicated policy functions is helpful when many builders reuse
them, but there's only one builder for the linux/loong64 port and its
configuration is more builder-specific than architecture-specific. So
inline them for now.

Change-Id: I0d478226663d3d92d885920c44dc7801ca63670b
Reviewed-on: https://go-review.googlesource.com/c/build/+/459875
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index 2ba99db..89c4221 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -2820,12 +2820,25 @@
 		},
 	})
 	addBuilder(BuildConfig{
-		FlakyNet:       true,
-		HostType:       "host-linux-loong64-3a5000",
-		Name:           "linux-loong64-3a5000",
-		SkipSnapshot:   true,
-		distTestAdjust: loong64DistTestPolicy,
-		buildsRepo:     loong64BuildsRepoPolicy,
+		FlakyNet:     true,
+		HostType:     "host-linux-loong64-3a5000",
+		Name:         "linux-loong64-3a5000",
+		SkipSnapshot: true,
+		distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
+			switch distTest {
+			case "api", "reboot":
+				return false
+			}
+			return run
+		},
+		buildsRepo: func(repo, branch, goBranch string) bool {
+			switch repo {
+			case "go", "net", "sys":
+				return branch == "master" && goBranch == "master"
+			default:
+				return false
+			}
+		},
 		privateGoProxy: true, // this builder is behind firewall
 		env: []string{
 			"GOARCH=loong64",
@@ -3208,25 +3221,6 @@
 // riscvDistTestPolicy is same as mipsDistTestPolicy for now.
 var riscvDistTestPolicy = mipsDistTestPolicy
 
-// loong64DistTestPolicy is a distTestAdjust policy function
-func loong64DistTestPolicy(run bool, distTest string, isNormalTry bool) bool {
-	switch distTest {
-	case "api", "reboot":
-		return false
-	}
-	return run
-}
-
-// loong64BuildsRepoPolicy is a buildsRepo policy function
-func loong64BuildsRepoPolicy(repo, branch, goBranch string) bool {
-	switch repo {
-	case "go", "net", "sys":
-		return branch == "master" && goBranch == "master"
-	default:
-		return false
-	}
-}
-
 // TryBuildersForProject returns the builders that should run as part of
 // a TryBot set for the given project.
 // The project argument is of the form "go", "net", "sys", etc.