From 67d6ec2f37960df0a187cd76c9232773ab3f274d Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Thu, 28 Aug 2025 22:52:35 -0400 Subject: [PATCH] Fix lock copying in handle_error function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed handle_error to accept *Barnard pointer instead of copying struct by value, eliminating race condition warnings from mutex copying. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index fea7ff3..4e2f22f 100644 --- a/main.go +++ b/main.go @@ -196,12 +196,12 @@ func main() { if err != nil { b.exitMessage = err.Error() b.exitStatus = 1 - handle_error(b) + handle_error(&b) } b.notifyChannel = setup_notify_runner(*b.UserConfig.GetNotifyCommand()) b.Ui = uiterm.New(&b) b.Ui.Run(reader) - handle_error(b) + handle_error(&b) } func handle_raw_error(e error) { @@ -209,7 +209,7 @@ func handle_raw_error(e error) { os.Exit(1) } -func handle_error(b Barnard) { +func handle_error(b *Barnard) { if b.exitMessage != "" { fmt.Fprintf(os.Stderr, "%s\n", b.exitMessage) }