Skip to content

Commit

Permalink
Fix staticcheck warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyak committed Mar 12, 2022
1 parent e27c845 commit eebd021
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 202 deletions.
3 changes: 1 addition & 2 deletions chatclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Client struct {
CmdLevel common.CommandLevel
IsColorForced bool
IsNameForced bool
regexName *regexp.Regexp

// Times since last event. use time.Duration.Since()
nextChat time.Time // rate limit chat messages
Expand Down Expand Up @@ -276,7 +275,7 @@ func (cl *Client) replaceColorizedName(chatData common.ChatData) common.ChatData
newWords := []string{}

for _, word := range words {
if strings.ToLower(word) == strings.ToLower(cl.name) || strings.ToLower(word) == strings.ToLower("@"+cl.name) {
if strings.EqualFold(word, strings.TrimPrefix(cl.name, "@")) {
newWords = append(newWords, `<span class="mention">`+word+`</span>`)
} else {
newWords = append(newWords, word)
Expand Down
Loading

0 comments on commit eebd021

Please sign in to comment.