aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/report
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-05-27 17:29:36 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-05-27 15:38:45 +0000
commit0cdd36fc443630fa8b6c5d7903cb7adc0baac5b5 (patch)
treef5c27bbb4a809970d83cba87df5bf7638639763c /pkg/report
parent1f9b5e5c3aa41af3a1403e3933f20a2776eb5f4b (diff)
sys/targets: add consts for gvisor/starnix
Lint started warning about duplicate "gvisor" const in pkg/cover. Add gvisor/starnix consts to sys/targets package to avoid duplication.
Diffstat (limited to 'pkg/report')
-rw-r--r--pkg/report/report.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/report/report.go b/pkg/report/report.go
index 2003b8b83..b211a140e 100644
--- a/pkg/report/report.go
+++ b/pkg/report/report.go
@@ -83,7 +83,7 @@ const unspecifiedType = crash.Type("UNSPECIFIED")
// NewReporter creates reporter for the specified OS/Type.
func NewReporter(cfg *mgrconfig.Config) (*Reporter, error) {
typ := cfg.TargetOS
- if cfg.Type == "gvisor" || cfg.Type == "starnix" {
+ if cfg.Type == targets.GVisor || cfg.Type == targets.Starnix {
typ = cfg.Type
}
ctor := ctors[typ]
@@ -139,8 +139,8 @@ const (
var ctors = map[string]fn{
targets.Linux: ctorLinux,
- "starnix": ctorFuchsia,
- "gvisor": ctorGvisor,
+ targets.Starnix: ctorFuchsia,
+ targets.GVisor: ctorGvisor,
targets.FreeBSD: ctorFreebsd,
targets.Darwin: ctorDarwin,
targets.NetBSD: ctorNetbsd,