Skip to content

Conversation

@AkihiroSuda
Copy link
Member

  • fmt.Errorf: use %w, not %v to wrap errors
  • fs: fix wrapping nil err

Follow-up to:

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit cd17c99 into containerd:main Mar 25, 2022
default:
// TODO: Support pipes and sockets
return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err)
if err != nil {
Copy link
Member

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.

Copy link
Member Author

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)
}
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants