From 39a47a9470a1ac14b1afaee299faed09d384b4f8 Mon Sep 17 00:00:00 2001 From: fjerlov-cs <158591046+fjerlov-cs@users.noreply.github.com> Date: Wed, 13 Mar 2024 14:03:29 +0100 Subject: [PATCH] Satisfy staticcheck for filter-alerts (#154) --- api/filter-alerts.go | 2 +- cmd/humioctl/filter_alerts_list.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/api/filter-alerts.go b/api/filter-alerts.go index 6e80ed3..3a45f3e 100644 --- a/api/filter-alerts.go +++ b/api/filter-alerts.go @@ -159,7 +159,7 @@ func (fa *FilterAlerts) Delete(viewName, filterAlertID string) error { err := fa.client.Mutate(&mutation, variables) - if mutation.DidDelete == false { + if !mutation.DidDelete { return fmt.Errorf("unable to remove filter alert in repo/view '%s' with id '%s'", viewName, filterAlertID) } diff --git a/cmd/humioctl/filter_alerts_list.go b/cmd/humioctl/filter_alerts_list.go index 4a70b23..d5b6712 100644 --- a/cmd/humioctl/filter_alerts_list.go +++ b/cmd/humioctl/filter_alerts_list.go @@ -36,18 +36,12 @@ func newFilterAlertsListCmd() *cobra.Command { var rows = make([][]format.Value, len(filterAlerts)) for i := range filterAlerts { filterAlert := filterAlerts[i] - - var actionNames = make([]string, len(filterAlert.ActionNames)) - for j := range filterAlert.ActionNames { - actionNames[j] = filterAlert.ActionNames[j] - } - rows[i] = []format.Value{ format.String(filterAlert.ID), format.String(filterAlert.Name), format.Bool(filterAlert.Enabled), format.String(filterAlert.Description), - format.String(strings.Join(actionNames, ", ")), + format.String(strings.Join(filterAlert.ActionNames, ", ")), format.String(strings.Join(filterAlert.Labels, ", ")), format.String(filterAlert.RunAsUserID), format.String(filterAlert.QueryOwnershipType),