aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/api.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-10-26 10:51:06 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-10-26 15:44:28 +0100
commite6e35dba937599d098fc034eff2686e5ddc409e9 (patch)
tree802be708d0bc84dee01b9285639690a53f1f6f94 /dashboard/app/api.go
parentd46bc75207fea1d7671c1277dd660cf1a4d7847b (diff)
sys/targets: add OS/Arch name consts
We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
Diffstat (limited to 'dashboard/app/api.go')
-rw-r--r--dashboard/app/api.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go
index 73a802d61..f802603d8 100644
--- a/dashboard/app/api.go
+++ b/dashboard/app/api.go
@@ -19,6 +19,7 @@ import (
"github.com/google/syzkaller/dashboard/dashapi"
"github.com/google/syzkaller/pkg/email"
"github.com/google/syzkaller/pkg/hash"
+ "github.com/google/syzkaller/sys/targets"
"golang.org/x/net/context"
"google.golang.org/appengine"
db "google.golang.org/appengine/datastore"
@@ -784,7 +785,7 @@ func saveCrash(c context.Context, ns string, req *dashapi.Crash, bugKey *db.Key,
} else if len(req.ReproSyz) != 0 {
prio += 2e12
}
- if build.Arch == "amd64" {
+ if build.Arch == targets.AMD64 {
prio += 1e3
}
crash := &Crash{