From c916a0ada95998b9dff3859b15dbc5fcdea1fc8f Mon Sep 17 00:00:00 2001 From: Denny Reeh Date: Thu, 9 Oct 2025 18:40:03 +0200 Subject: [PATCH] added forbidigo linter and allow two printf calls --- .golangci.yml | 1 + tea.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 929cb0ac99..3ad9c156aa 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,6 +5,7 @@ linters: enable: - bodyclose - exhaustive + - forbidigo - goconst - godot - gomoddirectives diff --git a/tea.go b/tea.go index db84343e3e..1c35b0f343 100644 --- a/tea.go +++ b/tea.go @@ -842,8 +842,8 @@ func (p *Program) recoverFromPanic(r interface{}) { case p.errs <- ErrProgramPanic: default: } - p.shutdown(true) // Ok to call here, p.Run() cannot do it anymore. - fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r) + p.shutdown(true) // Ok to call here, p.Run() cannot do it anymore. + fmt.Printf("Caught panic:\n\n%s\n\nRestoring terminal...\n\n", r) //nolint:forbidigo debug.PrintStack() } @@ -855,7 +855,7 @@ func (p *Program) recoverFromGoPanic(r interface{}) { default: } p.cancel() - fmt.Printf("Caught goroutine panic:\n\n%s\n\nRestoring terminal...\n\n", r) + fmt.Printf("Caught goroutine panic:\n\n%s\n\nRestoring terminal...\n\n", r) //nolint:forbidigo debug.PrintStack() }