-
Notifications
You must be signed in to change notification settings - Fork 1k
Guard against errs in stripVendor WalkFunc #1026
Changes from 1 commit
b4373a7
8f928b1
b4ff96f
151b3c8
8c85179
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ import ( | |
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, the |
||
|
||
func stripVendor(path string, info os.FileInfo, err error) error { | ||
if err != nil && err != filepath.SkipDir { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, that was actually the problem, i think - see my comment on main thread. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you actually seen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's possible that i'm cargo culting this, lemme see |
||
return err | ||
} | ||
|
||
if info.Name() == "vendor" { | ||
if _, err := os.Lstat(path); err == nil { | ||
symlink := (info.Mode() & os.ModeSymlink) != 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the
errCh
buffer is too small since each routine could send 2 errors. Does that even make sense? Or should the first error terminate the goroutine? (maybe defer thewg.Done()
so we can return from there)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes good call