Skip to content

add coverage for IsXXX helpers, and use stdlib unwrapping for customMessage#23

Open
thaJeztah wants to merge 2 commits into
containerd:mainfrom
thaJeztah:add_coverage
Open

add coverage for IsXXX helpers, and use stdlib unwrapping for customMessage#23
thaJeztah wants to merge 2 commits into
containerd:mainfrom
thaJeztah:add_coverage

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates customMessage to participate in Go’s standard error unwrapping (via Unwrap()), and expands test coverage to systematically verify the behavior of the IsXxx helper functions across sentinel errors, %w wrapping, Moby-style interface-based errors, and errors.Join.

Changes:

  • Replace customMessage’s custom Is/As behavior with a standard Unwrap() implementation.
  • Consolidate IsXxx helper testing into a single table-driven test that exercises sentinel, wrapped, interface-based, and joined errors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
errors.go Makes customMessage use stdlib unwrapping by adding Unwrap() and removing bespoke Is/As handling.
errors_test.go Adds broad, table-driven coverage for all IsXxx helpers including wrapping and errors.Join.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread errors.go

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Replace custom Is/As implementations with Unwrap and rely on
the standard errors package traversal.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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