-
Notifications
You must be signed in to change notification settings - Fork 68
Fix wrapping errors #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrapping errors #196
Conversation
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
estesp
left a comment
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.
LGTM
| default: | ||
| // TODO: Support pipes and sockets | ||
| return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err) | ||
| if err != nil { |
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.
I don't see how this can ever be non-nil.
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.
🤦 my bad
| return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err) | ||
| if err != nil { | ||
| return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err) | ||
| } |
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.
This does not fix #185 (comment) . It will just skip over this condition until it reaches copyFileInfo and errors there because the path does not exist.
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.
covered in:
fmt.Errorf: use %w, not %v to wrap errorsfs: fix wrapping nil errFollow-up to: