Skip to content

Replace pkg/errors with fmt.Errorf from stdlib - #2109

Merged
Seanstoppable merged 1 commit into
wtfutil:trunkfrom
Seanstoppable:seanstoppable-replace-pkg-errors
Jul 23, 2026
Merged

Seanstoppable merged 1 commit into
wtfutil:trunkfrom
Seanstoppable:seanstoppable-replace-pkg-errors

Conversation

@Seanstoppable

@Seanstoppable Seanstoppable commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Remove direct dependency on the archived github.com/pkg/errors package by replacing errors.Wrap/errors.Wrapf calls with fmt.Errorf using the %w verb (available since Go 1.13).

Changes

  • modules/docker/client.go — replaced 3 errors.Wrap/errors.Wrapf calls
  • modules/docker/widget.go — replaced 1 errors.Wrap call
  • modules/azuredevops/client.go — replaced 1 errors.Wrap call
  • modules/azuredevops/widget.go — replaced 1 errors.Wrap call

All "github.com/pkg/errors" imports removed from these files. go mod tidy run to clean up.

Note on indirect dependency

pkg/errors remains as an // indirect dependency in go.mod because two upstream libraries still use it:

  • bitbucket.org/mikehouston/asana-go (used by modules/asana) — the fork at github.com/kothar/asana-go also has this issue
  • github.com/adlio/trello (used by modules/todo_plus) — pkg/errors has been removed on main but no release has been tagged after v1.12.0

Once these upstream dependencies release versions without pkg/errors, updating them in go.mod will fully eliminate the indirect dependency.

Fixes #1734

Remove direct dependency on the archived github.com/pkg/errors package
by replacing errors.Wrap/Wrapf calls with fmt.Errorf using %w verb.

Fixes wtfutil#1734
@Seanstoppable
Seanstoppable force-pushed the seanstoppable-replace-pkg-errors branch from d7756d4 to fb218c4 Compare July 23, 2026 02:24
@Seanstoppable
Seanstoppable enabled auto-merge (squash) July 23, 2026 02:24
@Seanstoppable
Seanstoppable merged commit 9c18021 into wtfutil:trunk Jul 23, 2026
4 checks passed
@Seanstoppable
Seanstoppable deleted the seanstoppable-replace-pkg-errors branch July 23, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

pkg/errors dep is a dead project

1 participant

⌂ 换网址