Skip to content
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

Make ErrBadName checkable via errors.Is() #1462

Merged
merged 2 commits into from Oct 14, 2022
Merged

Commits on Oct 14, 2022

  1. Make ErrBadName checkable via errors.Is()

    The function IsErrBadName says it is deprecated and directs the user to
    use errors.Is(), but that will never return true because this error is
    custom based on the tag value.
    
    This fixes that problem by implementing an Is() function on ErrBadName
    so that errors.Is() can properly identify the error as an ErrBadName.
    Usage can now be: errors.Is(err, &ErrBadName{})
    
    Signed-off-by: Craig Jellick <craig@acorn.io>
    cjellick committed Oct 14, 2022
    Copy the full SHA
    1af0b88 View commit details
    Browse the repository at this point in the history
  2. Update pkg/name/errors_test.go

    Co-authored-by: Jason Hall <jason@chainguard.dev>
    cjellick and imjasonh committed Oct 14, 2022
    Copy the full SHA
    1f9fb02 View commit details
    Browse the repository at this point in the history