Skip to content

reduce uses of pkg/errors#6252

Merged
thaJeztah merged 13 commits intodocker:masterfrom
thaJeztah:less_pkg_errors
Aug 12, 2025
Merged

reduce uses of pkg/errors#6252
thaJeztah merged 13 commits intodocker:masterfrom
thaJeztah:less_pkg_errors

Conversation

@thaJeztah
Copy link
Member

Still various locations remaining, but some need to be reviewed if we can / should change.

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.0.0 milestone Aug 11, 2025
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Aug 11, 2025
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2025

@thaJeztah thaJeztah force-pushed the less_pkg_errors branch 4 times, most recently from fa1880c to 9bd49b7 Compare August 11, 2025 16:44
@thaJeztah thaJeztah requested a review from Copilot August 11, 2025 16:54

This comment was marked as outdated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link

Copilot AI left a comment

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 systematically replaces uses of github.com/pkg/errors with Go's standard library error handling, moving towards using errors and fmt.Errorf with error wrapping (%w verb) instead of the external package.

Key changes:

  • Replace errors.Wrap and errors.Wrapf with fmt.Errorf using %w verb for error wrapping
  • Replace errors.Errorf with fmt.Errorf or errors.New for simple error creation
  • Update error message formatting to use standard library approaches
  • Remove pkg/errors import statements and add errors and/or fmt imports where needed

Reviewed Changes

Copilot reviewed 50 out of 50 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/volumespec/volumespec.go Replace pkg/errors with standard library and fix slice initialization
e2e/cli-plugins/flags_test.go Update error message capitalization for consistency
cli/trust/*.go Convert error handling from pkg/errors to standard library
cli/required.go Replace error creation and fix typo in error message
cli/registry/client/*.go Convert error wrapping to use fmt.Errorf with %w
cli/manifest/types/types.go Replace error wrapping with standard library
cli/manifest/store/store.go Convert error formatting to use fmt.Errorf
cli/context/*.go Replace error wrapping with standard library approach
cli/config/*.go Convert error handling and improve defer error handling
cli/compose/*.go Extensive conversion from pkg/errors to standard library
cli/command/*.go Replace error handling and improve error handling patterns
cli/cobra.go Convert error creation to use fmt.Errorf

return errors.Errorf(
"%[1]s: '%[2]s' requires at most %[3]d %[4]s\n\nUsage: %[5]s\n\nSRun '%[2]s --help' for more information",
return fmt.Errorf(
"%[1]s: '%[2]s' requires at most %[3]d %[4]s\n\nUsage: %[5]s\n\nRun '%[2]s --help' for more information",
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

Fixed typo by removing extra 'S' from 'SRun' to 'Run'

Copilot uses AI. Check for mistakes.
@thaJeztah thaJeztah requested review from Benehiko and vvoland August 11, 2025 17:10
@thaJeztah thaJeztah merged commit bd0546a into docker:master Aug 12, 2025
102 of 103 checks passed
@thaJeztah thaJeztah deleted the less_pkg_errors branch August 12, 2025 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants