Skip to content

Conversation

@leonklingele
Copy link
Contributor

@leonklingele leonklingele commented Oct 24, 2025

It seems the "hashicorp/go-multierror" project has been unmaintained for quite some time already, see for example hashicorp/go-multierror#97 and hashicorp/go-multierror#98.
This also removes an uneccessary dependency which slims down the go.mod file.

Go as of version 1.20 supports appending errors with "errors.Join"1.

Footnotes

  1. https://pkg.go.dev/errors#Join

It seems the project has been unmainted for quite some time already,
see for example hashicorp/go-multierror#97
and hashicorp/go-multierror#98.
This also removes an uneccessary dependency which slims down the go.mod.

Go as of version 1.20 supports appending errors by specifying
multiple "%w" formatters in the "fmt.Errorf"[^0] function.

[^0]: https://pkg.go.dev/fmt#Errorf
As an update to the previous commit 59f084e,
use "errors.Join"[^0] instead of multiple "%w" formatters for "fmt.Errorf".

[^0]: https://pkg.go.dev/errors#Join
@leonklingele leonklingele force-pushed the feat/remove-hashicorp-multierror branch from afb45ba to 1996ec8 Compare October 24, 2025 00:16
@coveralls
Copy link

coveralls commented Oct 24, 2025

Coverage Status

coverage: 54.432% (+0.4%) from 54.049%
when pulling 51306a7 on leonklingele:feat/remove-hashicorp-multierror
into 472ef2e on golang-migrate:master.

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

@leonklingele Thanks so much for this PR! I'm all for fewer dependencies.
I like how the nil checks are built into errors.Join(), which simplifies the calling code.
Overall, this LGTM besides the breaking change.

// MultiError holds multiple errors.
//
// Deprecated: Use github.com/hashicorp/go-multierror instead
type MultiError struct {
Copy link
Member

Choose a reason for hiding this comment

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

Can you backout this removal as it's a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with 8cc9cb0, ptal :)

@leonklingele leonklingele requested a review from dhui November 27, 2025 07:58
Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

@leonklingele Thanks for adding MultiError back. Could you also update the struct comment?

util.go Outdated
"strings"
)

// TODO: This file is not in use anymore inside this project.
Copy link
Member

Choose a reason for hiding this comment

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

This comment isn't accurate as FilterCustomQuery is still used. You can update the comment below to mention removing the struct in v5. Also, we should recommend using errors.Join instead of go-multierror.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're absolutely right 🙈 Updated!

@leonklingele leonklingele requested a review from dhui November 28, 2025 16:17
@leonklingele leonklingele force-pushed the feat/remove-hashicorp-multierror branch from 8cc9cb0 to 51306a7 Compare November 28, 2025 16:17
Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

@leonklingele Thanks for addressing my feedback!

@dhui dhui merged commit 89e308c into golang-migrate:master Nov 29, 2025
8 checks passed
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