Skip to content

Replace deprecated pkg/errors with Go standard library errors#9520

Merged
chaptersix merged 3 commits intotemporalio:mainfrom
sachinsharma3191:remove-pkg-errors
Mar 17, 2026
Merged

Replace deprecated pkg/errors with Go standard library errors#9520
chaptersix merged 3 commits intotemporalio:mainfrom
sachinsharma3191:remove-pkg-errors

Conversation

@sachinsharma3191
Copy link
Copy Markdown
Contributor

@sachinsharma3191 sachinsharma3191 commented Mar 15, 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?

  • built
  • run locally and tested manually
  • 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.

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
@sachinsharma3191 sachinsharma3191 requested review from a team as code owners March 15, 2026 07:07
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 15, 2026

CLA assistant check
All committers have signed the CLA.

@chaptersix
Copy link
Copy Markdown
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
Copy link
Copy Markdown
Contributor

don't make any changes

@chaptersix chaptersix merged commit 7c0a18f into temporalio:main Mar 17, 2026
46 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants