Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests: isolate test using errors.Unwrap #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolmen
Copy link

@dolmen dolmen commented Mar 21, 2024

Isolate TestWrappedError_IsCompatibleWithErrorsUnwrap which uses errors.Unwrap (which appeared with Go 1.13) in a separate test source compiled only for Go 1.13+.

Note: other tests that use %w with fmt.Errorf should be isolated too. I will provide those changes once this PR is accepted.

Isolate TestWrappedError_IsCompatibleWithErrorsUnwrap which uses
errors.Unwrap (which appeared with Go 1.13) in a separate test source
compiled only for Go 1.13+.
@dolmen
Copy link
Author

dolmen commented Mar 21, 2024

Cc: @dnephin for review as you contributed #9

@dnephin
Copy link
Contributor

dnephin commented Mar 23, 2024

Hello, thank you for the PR! I am no longer a maintainer on this project, so I can't give you an official position.

If I understand correctly, you are making this change to support Go versions earlier than go1.13. The Go team only supports the latest two versions (Go1.21, Go1.22), and most libraries follow the same practice. go1.12 is sufficiently old now that I would say moving the code to a separate file is not worth it.

@dolmen
Copy link
Author

dolmen commented Mar 24, 2024

The project has no Go version mentioned in go.mod, so there is no official stance about the minimum Go version supported.

This project still exists to support downstream projects which haven't yet fully embraced the improved error interface from go1.13 and go1.20. Newer code should move away from it.
So nowadays maintaining this project is only relevant to keep running older Go code that might be running on recent go versions or not.

I'm a candidate for being a co-maintainer if necessary (FYI I'm also the current lead maintainer of Testify, if that matters regarding maintaining an old codebase).

@dolmen
Copy link
Author

dolmen commented Mar 24, 2024

(Note that I'm also supporting the effort to detach go-multierror from errwrap: hashicorp/go-multierror#60)

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.

None yet

2 participants