Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #453 from atc0005/fix-goconst-linting-errors
Browse files Browse the repository at this point in the history
Fix goconst linting errors
  • Loading branch information
atc0005 authored Nov 17, 2023
2 parents 2a71d1f + 38490e3 commit 619cc30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions cmd/brick/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ package main

// MB represents 1 Megabyte
const MB int64 = 1048576

const (
recordActionStep2of3 string = "[step 2 of 3]"
recordActionStep3of3 string = "[step 3 of 3]"
recordActionUnknownRecord string = "[UNKNOWN]"
)
14 changes: 7 additions & 7 deletions cmd/brick/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,28 +176,28 @@ func getMsgTitle(msgTitlePrefix string, record events.Record) string {
// TODO: Calculate step labeling based off of enabled features (see GH-65).

case events.ActionSuccessDisableRequestReceived, events.ActionFailureDisableRequestReceived:
msgCardTitle = msgTitlePrefix + "[step 1 of 3] " + record.Action
msgCardTitle = msgTitlePrefix + recordActionStep2of3 + " " + record.Action

case events.ActionSuccessDisabledUsername, events.ActionFailureDisabledUsername:
msgCardTitle = msgTitlePrefix + "[step 2 of 3] " + record.Action
msgCardTitle = msgTitlePrefix + recordActionStep2of3 + " " + record.Action

case events.ActionSuccessDuplicatedUsername, events.ActionFailureDuplicatedUsername:
msgCardTitle = msgTitlePrefix + "[step 2 of 3] " + record.Action
msgCardTitle = msgTitlePrefix + recordActionStep2of3 + " " + record.Action

case events.ActionSuccessIgnoredUsername, events.ActionFailureIgnoredUsername:
msgCardTitle = msgTitlePrefix + "[step 2 of 3] " + record.Action
msgCardTitle = msgTitlePrefix + recordActionStep2of3 + " " + record.Action

case events.ActionSuccessIgnoredIPAddress, events.ActionFailureIgnoredIPAddress:
msgCardTitle = msgTitlePrefix + "[step 2 of 3] " + record.Action
msgCardTitle = msgTitlePrefix + recordActionStep2of3 + " " + record.Action

case events.ActionSuccessTerminatedUserSession,
events.ActionFailureUserSessionLookupFailure,
events.ActionFailureTerminatedUserSession,
events.ActionSkippedTerminateUserSessions:
msgCardTitle = msgTitlePrefix + "[step 3 of 3] " + record.Action
msgCardTitle = msgTitlePrefix + recordActionStep3of3 + " " + record.Action

default:
msgCardTitle = msgTitlePrefix + " [UNKNOWN] " + record.Action
msgCardTitle = msgTitlePrefix + " " + recordActionUnknownRecord + " " + record.Action
log.Warnf("UNKNOWN record: %v+\n", record)
}

Expand Down

0 comments on commit 619cc30

Please sign in to comment.