Replace deprecated pkg/errors with Go standard library errors#9520
Merged
chaptersix merged 3 commits intotemporalio:mainfrom Mar 17, 2026
Merged
Replace deprecated pkg/errors with Go standard library errors#9520chaptersix merged 3 commits intotemporalio:mainfrom
chaptersix merged 3 commits intotemporalio:mainfrom
Conversation
Remove usage of github.com/pkg/errors and replace with standard library errors and fmt.Errorf wrapping. Changes: - common/finalizer/finalizer.go - service/worker/migration/activities.go - remove pkg/errors direct dependency via go mod tidy Addresses part of temporalio#9244 Made-with: Cursor
Contributor
|
Thank you for your contribution. Please fix the import order issue and any other lints that pop up. Happy to approve after that |
chaptersix
approved these changes
Mar 17, 2026
Contributor
|
don't make any changes |
stephanos
pushed a commit
that referenced
this pull request
Mar 18, 2026
Remove usage of github.com/pkg/errors and replace with standard library errors and fmt.Errorf wrapping. Changes: - common/finalizer/finalizer.go - service/worker/migration/activities.go - remove pkg/errors direct dependency via go mod tidy Addresses part of #9244 ## What changed? - Replaced `github.com/pkg/errors` with Go standard library `errors` in `common/finalizer/finalizer.go` (only uses `errors.New`) - Replaced `errors.WithMessage` with `fmt.Errorf` and `%w` in `service/worker/migration/activities.go` - Dropped direct `pkg/errors` dependency from `go.mod`; it remains as an indirect dependency from `uber-go/tally` ## Why? `github.com/pkg/errors` is deprecated and unmaintained. The standard library `errors` and `fmt.Errorf` with `%w` cover the same use cases and support `errors.Is` and `errors.As` for error unwrapping. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks None. The changes are localized and behavior is unchanged; tests for the modified packages pass. pleas commti and push it There’s nothing new to commit: the working tree has no staged or modified files. The pkg/errors changes are already committed and pushed on remove-pkg-errors (commit 52dbb1d). The only untracked items are test artifacts under common/persistence/tests/test_0315064513_*, which look like temporary files and shouldn’t be committed. --------- Co-authored-by: alex.stanfield <13949480+chaptersix@users.noreply.github.com>
stephanos
pushed a commit
that referenced
this pull request
Mar 20, 2026
Remove usage of github.com/pkg/errors and replace with standard library errors and fmt.Errorf wrapping. Changes: - common/finalizer/finalizer.go - service/worker/migration/activities.go - remove pkg/errors direct dependency via go mod tidy Addresses part of #9244 ## What changed? - Replaced `github.com/pkg/errors` with Go standard library `errors` in `common/finalizer/finalizer.go` (only uses `errors.New`) - Replaced `errors.WithMessage` with `fmt.Errorf` and `%w` in `service/worker/migration/activities.go` - Dropped direct `pkg/errors` dependency from `go.mod`; it remains as an indirect dependency from `uber-go/tally` ## Why? `github.com/pkg/errors` is deprecated and unmaintained. The standard library `errors` and `fmt.Errorf` with `%w` cover the same use cases and support `errors.Is` and `errors.As` for error unwrapping. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks None. The changes are localized and behavior is unchanged; tests for the modified packages pass. pleas commti and push it There’s nothing new to commit: the working tree has no staged or modified files. The pkg/errors changes are already committed and pushed on remove-pkg-errors (commit 52dbb1d). The only untracked items are test artifacts under common/persistence/tests/test_0315064513_*, which look like temporary files and shouldn’t be committed. --------- Co-authored-by: alex.stanfield <13949480+chaptersix@users.noreply.github.com>
birme
pushed a commit
to eyevinn-osaas/temporal
that referenced
this pull request
Mar 23, 2026
…alio#9520) Remove usage of github.com/pkg/errors and replace with standard library errors and fmt.Errorf wrapping. Changes: - common/finalizer/finalizer.go - service/worker/migration/activities.go - remove pkg/errors direct dependency via go mod tidy Addresses part of temporalio#9244 ## What changed? - Replaced `github.com/pkg/errors` with Go standard library `errors` in `common/finalizer/finalizer.go` (only uses `errors.New`) - Replaced `errors.WithMessage` with `fmt.Errorf` and `%w` in `service/worker/migration/activities.go` - Dropped direct `pkg/errors` dependency from `go.mod`; it remains as an indirect dependency from `uber-go/tally` ## Why? `github.com/pkg/errors` is deprecated and unmaintained. The standard library `errors` and `fmt.Errorf` with `%w` cover the same use cases and support `errors.Is` and `errors.As` for error unwrapping. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks None. The changes are localized and behavior is unchanged; tests for the modified packages pass. pleas commti and push it There’s nothing new to commit: the working tree has no staged or modified files. The pkg/errors changes are already committed and pushed on remove-pkg-errors (commit 52dbb1d). The only untracked items are test artifacts under common/persistence/tests/test_0315064513_*, which look like temporary files and shouldn’t be committed. --------- Co-authored-by: alex.stanfield <13949480+chaptersix@users.noreply.github.com>
stephanos
pushed a commit
that referenced
this pull request
Mar 23, 2026
Remove usage of github.com/pkg/errors and replace with standard library errors and fmt.Errorf wrapping. Changes: - common/finalizer/finalizer.go - service/worker/migration/activities.go - remove pkg/errors direct dependency via go mod tidy Addresses part of #9244 ## What changed? - Replaced `github.com/pkg/errors` with Go standard library `errors` in `common/finalizer/finalizer.go` (only uses `errors.New`) - Replaced `errors.WithMessage` with `fmt.Errorf` and `%w` in `service/worker/migration/activities.go` - Dropped direct `pkg/errors` dependency from `go.mod`; it remains as an indirect dependency from `uber-go/tally` ## Why? `github.com/pkg/errors` is deprecated and unmaintained. The standard library `errors` and `fmt.Errorf` with `%w` cover the same use cases and support `errors.Is` and `errors.As` for error unwrapping. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks None. The changes are localized and behavior is unchanged; tests for the modified packages pass. pleas commti and push it There’s nothing new to commit: the working tree has no staged or modified files. The pkg/errors changes are already committed and pushed on remove-pkg-errors (commit 52dbb1d). The only untracked items are test artifacts under common/persistence/tests/test_0315064513_*, which look like temporary files and shouldn’t be committed. --------- Co-authored-by: alex.stanfield <13949480+chaptersix@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove usage of github.com/pkg/errors and replace with standard library errors and fmt.Errorf wrapping.
Changes:
Addresses part of #9244
What changed?
github.com/pkg/errorswith Go standard libraryerrorsincommon/finalizer/finalizer.go(only useserrors.New)errors.WithMessagewithfmt.Errorfand%winservice/worker/migration/activities.gopkg/errorsdependency fromgo.mod; it remains as an indirect dependency fromuber-go/tallyWhy?
github.com/pkg/errorsis deprecated and unmaintained. The standard libraryerrorsandfmt.Errorfwith%wcover the same use cases and supporterrors.Isanderrors.Asfor error unwrapping.How did you test it?
Potential risks
None. The changes are localized and behavior is unchanged; tests for the modified packages pass.
pleas commti and push it
There’s nothing new to commit: the working tree has no staged or modified files.
The pkg/errors changes are already committed and pushed on remove-pkg-errors (commit 52dbb1d).
The only untracked items are test artifacts under common/persistence/tests/test_0315064513_*, which look like temporary files and shouldn’t be committed.