Skip to content

Commit

Permalink
Chores
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyaren committed Feb 20, 2024
1 parent b2d8637 commit 03e1cd2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
#- depguard
- dogsled
- dupl
Expand All @@ -104,13 +103,11 @@ linters:
- nolintlint
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- asciicheck
# - scopelint
Expand Down
11 changes: 6 additions & 5 deletions cmd/arcdps-log-uploader/ui/textgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func generateMessageTextDiscord(entries []*model.ArcLog, formatOptions FormatOpt
currentMessage = currentMessagePlusThisLine
}
}
if len(currentMessage) > 0 {
if currentMessage != "" {
messages = append(messages, currentMessage)
}

Expand Down Expand Up @@ -159,7 +159,7 @@ func generateMessageTextTeamspeak(entries []*model.ArcLog, formatOptions FormatO
currentMessage = currentMessagePlusThisLine
}
}
if len(currentMessage) > 0 {
if currentMessage != "" {
messages = append(messages, currentMessage)
}

Expand All @@ -177,21 +177,22 @@ func generateMessageTextTeamspeak(entries []*model.ArcLog, formatOptions FormatO
func headline(title string, dateTime time.Time, multipleDays bool) string {
var elements = make([]string, 0)
trimmedTitle := strings.TrimSpace(title)
if len(trimmedTitle) > 0 {
if trimmedTitle != "" {
elements = append(elements, trimmedTitle)
}

if !multipleDays {
elements = append(elements, dateTime.Format("02.01.2006"))
}

return "**" + strings.Join(elements, " ") + "**"
const bold = "**"
return bold + strings.Join(elements, " ") + bold
}

func headlineTeamspeak(title string, dateTime time.Time, multipleDays bool) string {
var elements = make([]string, 0)
trimmedTitle := strings.TrimSpace(title)
if len(trimmedTitle) > 0 {
if trimmedTitle != "" {
elements = append(elements, trimmedTitle)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/arcdps-log-uploader/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func shouldRetryBeAllowed(tv *walk.TableView, m *ArcLogModel) bool {
func checkBrowsable(tv *walk.TableView, m *ArcLogModel) bool {
if len(tv.SelectedIndexes()) == 1 {
arcLog := m.items[tv.SelectedIndexes()[0]]
if arcLog.Status == model.Done && arcLog.Report != nil && len(arcLog.Report.Permalink) > 0 {
if arcLog.Status == model.Done && arcLog.Report != nil && arcLog.Report.Permalink != "" {
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/arcdps-log-uploader/utils/idler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (i *Idler) Call() {
defer i.mu.Unlock()

now := time.Now()
if !i.lastInvocation.Add(i.idleTimeout).After(now) { //nolint:gocritic
if !i.lastInvocation.Add(i.idleTimeout).After(now) {
i.lastInvocation = now

go i.invoke()
Expand Down

0 comments on commit 03e1cd2

Please sign in to comment.