Skip to content

Commit

Permalink
lint: Add tea.Quit to forbidigo to prevent future memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Apr 24, 2024
1 parent 5d0bf46 commit 6f13e20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ linters-settings:
gosec:
excludes:
- G306
forbidigo:
forbid:
- "^(fmt\\.Print(|f|ln)|print|println)$"
- p: "^tea\\.Quit$"
msg: tea.Quit may cause a memory leak

linters:
enable:
Expand Down
2 changes: 1 addition & 1 deletion internal/movie/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (p Player) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
p.clearTimeouts()
p.zone.Close()
return p, tea.Quit
return p, tea.Quit //nolint:forbidigo
case PlayerOption:
p.optionViewStale = true
return p, p.doPlayerOption(msg)
Expand Down

0 comments on commit 6f13e20

Please sign in to comment.