Fix lock copying in handle_error function.

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 <noreply@anthropic.com>
This commit is contained in:
Storm Dragon
2025-08-28 22:52:35 -04:00
parent 5ed445060c
commit 67d6ec2f37

View File

@@ -196,12 +196,12 @@ func main() {
if err != nil { if err != nil {
b.exitMessage = err.Error() b.exitMessage = err.Error()
b.exitStatus = 1 b.exitStatus = 1
handle_error(b) handle_error(&b)
} }
b.notifyChannel = setup_notify_runner(*b.UserConfig.GetNotifyCommand()) b.notifyChannel = setup_notify_runner(*b.UserConfig.GetNotifyCommand())
b.Ui = uiterm.New(&b) b.Ui = uiterm.New(&b)
b.Ui.Run(reader) b.Ui.Run(reader)
handle_error(b) handle_error(&b)
} }
func handle_raw_error(e error) { func handle_raw_error(e error) {
@@ -209,7 +209,7 @@ func handle_raw_error(e error) {
os.Exit(1) os.Exit(1)
} }
func handle_error(b Barnard) { func handle_error(b *Barnard) {
if b.exitMessage != "" { if b.exitMessage != "" {
fmt.Fprintf(os.Stderr, "%s\n", b.exitMessage) fmt.Fprintf(os.Stderr, "%s\n", b.exitMessage)
} }