From 0cdd36fc443630fa8b6c5d7903cb7adc0baac5b5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 27 May 2024 17:29:36 +0200 Subject: 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. --- pkg/report/report.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/report') 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, -- cgit mrf-deployment