From 057db23d09b37826ef9815e005a0383e37d07344 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 27 Mar 2025 23:06:46 +0100 Subject: [PATCH] Implement panic recovery :?? --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 035c14f..6d376cb 100644 --- a/main.go +++ b/main.go @@ -93,7 +93,7 @@ func main() { for file, commands := range associations { workers <- struct{}{} wg.Add(1) - go func(file string, commands []utils.ModifyCommand) { + logger.SafeGoWithArgs(func(args ...interface{}) { defer func() { <-workers }() defer wg.Done() @@ -131,9 +131,9 @@ func main() { logger.Error("Failed to write file %q: %v", file, err) return } - }(file, commands) - wg.Wait() + }, file, commands) } + wg.Wait() // This will also relieve processor of some of the file loading // But we will also have to rework the tests.......