diff --git a/cmd/xeol/cli/commands/root.go b/cmd/xeol/cli/commands/root.go index 96311f44..98fa6be0 100644 --- a/cmd/xeol/cli/commands/root.go +++ b/cmd/xeol/cli/commands/root.go @@ -86,7 +86,7 @@ You can also pipe in Syft JSON directly: }, opts) } -//nolint:funlen +//nolint:funlen,gocognit func runXeol(app clio.Application, opts *options.Xeol, userInput string) error { errs := make(chan error) go func() { @@ -187,8 +187,7 @@ func runXeol(app clio.Application, opts *options.Xeol, userInput string) error { var failScan bool var imageVerified bool var sourceIsImageType bool - switch s.Source.Metadata.(type) { - case source.StereoscopeImageSourceMetadata: + if _, ok := s.Source.Metadata.(source.StereoscopeImageSourceMetadata); ok { sourceIsImageType = true } diff --git a/cmd/xeol/internal/ui/post_ui_event_writer.go b/cmd/xeol/internal/ui/post_ui_event_writer.go index 0e8decb5..9651720f 100644 --- a/cmd/xeol/internal/ui/post_ui_event_writer.go +++ b/cmd/xeol/internal/ui/post_ui_event_writer.go @@ -13,7 +13,6 @@ import ( "github.com/xeol-io/xeol/xeol/event" "github.com/xeol-io/xeol/xeol/event/parsers" - xeolEventParsers "github.com/xeol-io/xeol/xeol/event/parsers" policyTypes "github.com/xeol-io/xeol/xeol/policy/types" ) @@ -136,7 +135,7 @@ func writeNotifications(writer io.Writer, events ...partybus.Event) error { func writeNotaryPolicyEvaluationMessage(writer io.Writer, events ...partybus.Event) error { for _, e := range events { // show the report to stdout - nt, err := xeolEventParsers.ParseNotaryPolicyEvaluationMessage(e) + nt, err := parsers.ParseNotaryPolicyEvaluationMessage(e) if err != nil { return fmt.Errorf("bad %s event: %w", e.Type, err) } @@ -165,7 +164,7 @@ func writeNotaryPolicyEvaluationMessage(writer io.Writer, events ...partybus.Eve func writeEolPolicyEvaluationMessage(writer io.Writer, events ...partybus.Event) error { for _, e := range events { // show the report to stdout - pt, err := xeolEventParsers.ParseEolPolicyEvaluationMessage(e) + pt, err := parsers.ParseEolPolicyEvaluationMessage(e) if err != nil { return fmt.Errorf("bad %s event: %w", e.Type, err) }