Skip to content

Commit

Permalink
Satisfy staticcheck for filter-alerts (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjerlov-cs committed Mar 13, 2024
1 parent 359de49 commit 39a47a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/filter-alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
8 changes: 1 addition & 7 deletions cmd/humioctl/filter_alerts_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 39a47a9

Please sign in to comment.