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


##########
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:
   It is. I didn't look closely enough into the Result struct. It is an issue. 
I pushed a version which adds a mutex to make the Result struct thread-safe



##########
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:
   It is. I didn't look closely enough into the Result struct. I pushed a 
version which adds a mutex to make the Result struct thread-safe



-- 
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