From ab89e0b78c39d276e507b178c19184bfda5a060a Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Fri, 29 Nov 2024 11:30:43 +0000 Subject: [PATCH] fix: exiting with error if formatters fail Subtle bug where the formatError flag was getting reset. Signed-off-by: Brian McGee --- format/scheduler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format/scheduler.go b/format/scheduler.go index 9cb514ec..beac3292 100644 --- a/format/scheduler.go +++ b/format/scheduler.go @@ -154,7 +154,7 @@ func (s *scheduler) schedule(ctx context.Context, key batchKey, batch []*walk.Fi hasErrors := len(formatErrors) > 0 // update overall error tracking - s.formatError.Store(hasErrors) + s.formatError.CompareAndSwap(false, hasErrors) if !hasErrors { // record that the file was formatted