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

Add errdefs/pkg package #19

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

dmcgowan
Copy link
Member

Separate the error definitions from the packages which use them.

This will allow us to keep our error definitions in a 1.0 package that shouldn't ever need a 2.0 since we are basing the errors on a fixed set.

The libraries which create and manipulate the errors are likely to change and possibly need major version bumps. If the error definitions are in the same go module, this makes the error types incompatible through type checking and requires use of the interfaces. While the interfaces may be better for version compatibility, errors.Is is the most idiomatic solution.

@dims
Copy link
Member

dims commented Sep 30, 2024

Very supportive of this split. thanks @dmcgowan

pkg/go.mod Outdated
@@ -0,0 +1,16 @@
module github.com/containerd/errdefs/pkg

go 1.23.1
Copy link
Member

Choose a reason for hiding this comment

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

Can this be max go1.22?
The other go.mod is 1.20.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Separate the error definitions from the packages which
use them.

Signed-off-by: Derek McGowan <[email protected]>
go 1.22

require (
github.com/containerd/errdefs v0.2.0
Copy link
Member

Choose a reason for hiding this comment

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

I assume then we need to update this once we tag a new version?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we should update once we have the split version for sure

@dmcgowan dmcgowan merged commit 9fd32fc into containerd:main Oct 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants