Skip to content

Reopen in maintenance mode#247

Open
tonistiigi wants to merge 7 commits intopkg:masterfrom
tonistiigi:master
Open

Reopen in maintenance mode#247
tonistiigi wants to merge 7 commits intopkg:masterfrom
tonistiigi:master

Conversation

@tonistiigi
Copy link
Copy Markdown
Contributor

Maintainers from @moby project can take over keeping this repo available in maintenance mode.

From README:

This package is in maintenance mode. New features that extend the scope of the package are not being accepted and should be implemented in other modules. Exceptions would be features that improve interoperability with the standard library's errors package when it receives new features, as pkg/errors should mostly be able to act as a drop-in replacement. Bug fixes and reports are welcome. CI will be maintained to make sure the package is tested against new versions of Go and Go linting tools.

@thaJeztah

Add go.mod, targets to build, test and lint.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Copy link
Copy Markdown

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

Needs to bump actions to latest stable following Node 20 EOL coming soon on GitHub Hosted runners

@tonistiigi tonistiigi force-pushed the master branch 4 times, most recently from 3b5125c to c321b9f Compare March 27, 2026 15:23
"error\n" +
"github.com/pkg/errors.TestFormatNew\n" +
"\t.+/github.com/pkg/errors/format_test.go:26",
"\t.+/format_test.go:26",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Curious about these; were the tests wrong, or did behavior change between Go versions? (ISTR something changed in some of stdlib).

If it changed in Go, was that before, or after go1.20 (otherwise tests won't be valid with the minimum version specified in go.mod)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These tests were pre-gomod and expected checkout to be in GOPATH that is not a requirement anymore.

//go:build go1.13
// +build go1.13

package errors
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would squash the removal of the tags with the previous commits, but keep the removal of the Makefile in this one.

Copy link
Copy Markdown
Contributor Author

@tonistiigi tonistiigi Mar 30, 2026

Choose a reason for hiding this comment

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

These are opinionated changes, while the first commit is purely making the linter and test pass with the recent version of Go without changing anything about the code. Moved the makefile away.

Comment on lines +1 to +3
//go:build !go1.26

package errors
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This commit starts the work of picking up maintenance; I think it would make sense to move this (and forward) separate.

(Steps before this were just setting the baseline)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved to last

// GlobalE is an exported global to store the result of benchmark results,
// preventing the compiler from optimising the benchmark functions away.
var GlobalE interface{}
var GlobalE any
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

any was added in go1.18, and the module already had go1.20 as minimum; I think we can squash this one with the "fix linting" commit, or move it before the addition of the go1.26 features.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

modernize is not same as lint. These changes make the code use the latest conventions but are not required for the code to work properly and lint pass in recent Go.

Comment on lines +11 to +12
branches:
- master
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps add main to the list, so that we can rename the default branch.

This commit could also be put before the go1.26 feature commit, making it part of the "baseline".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renaming branches does not seem compliant with maintenance mode.

@thaJeztah
Copy link
Copy Markdown
Collaborator

Left some comments (sorry I reviewed per commit, so some got superseded in later commits).

Overall looks good; some things I think we should do;

  • Some commits can be squashed (see my comments)
  • Move the fix linting, remove old CI files, and general cleanups first
  • Move the go1.26 enhancement as a follow-up pull-request

@puellanivis
Copy link
Copy Markdown

I’m not sure the stacktrace feature is even useful. Most people tend to declare their errors at the top level, where the stacktrace ends up being _init anyways, and not anything useful pointing to where the error originated…

@tonistiigi
Copy link
Copy Markdown
Contributor Author

@puellanivis There is no obligation to use this package. This package works well with typed/static/chained errors; you add the stack trace to the return path, not to the definition path, if you use static errors.

Fix gofmt formatting, simplify code patterns flagged by
gocritic/staticcheck/revive, update test path expectations
to not assume GOPATH layout.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Remove go1.13 build constraints from unwrap functions
since go.mod minimum is go1.20. Rename go113.go and
go113_test.go to unwrap.go and unwrap_test.go. Delete
Makefile as build/test/lint are now handled by Docker
Bake targets.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Remove defunct Travis-CI and AppVeyor badges. Replace
the outdated Roadmap section with a comparison to the
standard library's errors package. Update Contributing
section to reflect current maintenance-mode policy.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.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.

4 participants