Skip to content

Add errdefs/pkg package#19

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:pkg-package
Oct 7, 2024
Merged

Add errdefs/pkg package#19
dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan:pkg-package

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

@dmcgowan dmcgowan marked this pull request as ready for review September 30, 2024 16:06
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

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