style: run golangci-lint run --fix

This commit is contained in:
ayn2op 2026-03-08 18:40:59 -04:00
parent 07c09508e8
commit 082c018f53
6 changed files with 12 additions and 18 deletions

View file

@ -31,7 +31,7 @@ func (c *Cache) Get(query string) uint {
// the search limit.
// "aa", "ab", "ac", ..., "ay" // where length is longer than the limit
// if "ay" leaves, then "az" would not be loaded becaue it would not be
// returned by the search results because of the search limit
// returned by the search results because of the search limit.
func (c *Cache) Invalidate(name string, limit uint) {
for name != "" {
if c.Exists(name) && c.Get(name) >= limit {

View file

@ -31,10 +31,6 @@ func (aw *AlignmentWrapper) UnmarshalTOML(v any) error {
type StyleWrapper struct{ tcell.Style }
func NewStyleWrapper(style tcell.Style) StyleWrapper {
return StyleWrapper{Style: style}
}
func (sw *StyleWrapper) UnmarshalTOML(v any) error {
m, ok := v.(map[string]any)
if !ok {
@ -64,7 +60,6 @@ func (sw *StyleWrapper) UnmarshalTOML(v any) error {
sw.parseAttr(s)
}
}
}
case "underline":
if s, ok := val.(string); ok {
@ -176,14 +171,14 @@ func (vw *ScrollBarVisibilityWrapper) UnmarshalTOML(val any) error {
return nil
}
type HelpTheme struct {
ShortKeyStyle StyleWrapper `toml:"short_key_style"`
ShortDescStyle StyleWrapper `toml:"short_desc_style"`
FullKeyStyle StyleWrapper `toml:"full_key_style"`
FullDescStyle StyleWrapper `toml:"full_desc_style"`
}
type (
HelpTheme struct {
ShortKeyStyle StyleWrapper `toml:"short_key_style"`
ShortDescStyle StyleWrapper `toml:"short_desc_style"`
FullKeyStyle StyleWrapper `toml:"full_key_style"`
FullDescStyle StyleWrapper `toml:"full_desc_style"`
}
ThemeStyle struct {
NormalStyle StyleWrapper `toml:"normal_style"`
ActiveStyle StyleWrapper `toml:"active_style"`

View file

@ -39,7 +39,7 @@ func (m *mentionsList) append(item mentionsListItem) {
func (m *mentionsList) clear() {
m.items = nil
m.List.Clear()
m.Clear()
}
func (m *mentionsList) rebuild() {

View file

@ -496,7 +496,7 @@ func (ul userList) Len() int {
return len(ul)
}
// channelHasUser checks if a user has permission to view the specified channel
// channelHasUser checks if a user has permission to view the specified channel.
func channelHasUser(state *ningen.State, channelID discord.ChannelID, userID discord.UserID) bool {
perms, err := state.Permissions(channelID, userID)
if err != nil {
@ -622,7 +622,6 @@ func (mi *messageInput) addMentionUser(user *discord.User) {
})
}
// used by chatView
func (mi *messageInput) removeMentionsList() {
mi.chatView.HideLayer(mentionsListLayerName)
}

View file

@ -774,7 +774,7 @@ func unescapeMarkdownEscapes(s string) string {
var b strings.Builder
b.Grow(len(s))
for i := 0; i < len(s); i++ {
for i := range len(s) {
if s[i] == '\\' && i+1 < len(s) && isMarkdownEscapable(s[i+1]) {
continue
}

View file

@ -418,7 +418,7 @@ func (v *View) updateFooter() {
switch len(names) {
case 1:
footer = fmt.Sprintf("%s is typing...", names[0])
footer = names[0] + " is typing..."
case 2:
footer = fmt.Sprintf("%s and %s are typing...", names[0], names[1])
case 3: