Copilot commented on code in PR #257:
URL: https://github.com/apache/skywalking-eyes/pull/257#discussion_r2692422451


##########
pkg/header/check.go:
##########
@@ -44,10 +46,18 @@ func Check(config *ConfigHeader, result *Result) error {
                return err
        }
 
+       g := new(errgroup.Group)
+       g.SetLimit(runtime.GOMAXPROCS(0))
+
        for _, file := range fileList {
-               if err := CheckFile(file, config, result); err != nil {
-                       return err
-               }
+               f := file
+               g.Go(func() error {
+                       return CheckFile(f, config, result)
+               })
+       }

Review Comment:
   The `Result` struct methods (`Succeed`, `Fail`, `Ignore`) perform 
unsynchronized slice appends in concurrent goroutines, causing race conditions. 
The `Result` type (lines 32-42 in result.go) uses direct slice appends without 
any synchronization mechanism like `sync.Mutex`. This will lead to data races 
and potentially lost results or corrupted data when multiple goroutines write 
to the same Result instance simultaneously.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to