-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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.