Skip to content

Make xattr.Error implement Unwrap#66

Merged
kuba-- merged 1 commit intopkg:masterfrom
aureliar8:master
Jun 15, 2022
Merged

Make xattr.Error implement Unwrap#66
kuba-- merged 1 commit intopkg:masterfrom
aureliar8:master

Conversation

@aureliar8
Copy link
Contributor

@aureliar8 aureliar8 commented Jun 14, 2022

This makes xattr.Error implement the Unwrap interface. It allows consumers to inspect the errors more efficiently like:

_, err := xattr.Get("file", "attribute")
if err != nil {
    if errors.Is(err, fs.ErrNotFound) {
        //Do something
    }
}

@aureliar8 aureliar8 changed the title Make *Error implement Unwrap Make xattr.Error implement Unwrap Jun 14, 2022
@kuba--
Copy link
Member

kuba-- commented Jun 15, 2022

Thanks

@kuba-- kuba-- merged commit 5a86313 into pkg:master Jun 15, 2022
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.

2 participants