chore: remove dependency on "hashicorp/go-multierror"#1322
chore: remove dependency on "hashicorp/go-multierror"#1322dhui merged 3 commits intogolang-migrate:masterfrom
Conversation
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
afb45ba to
1996ec8
Compare
dhui
left a comment
There was a problem hiding this comment.
@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 { |
There was a problem hiding this comment.
Can you backout this removal as it's a breaking change?
dhui
left a comment
There was a problem hiding this comment.
@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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
You're absolutely right 🙈 Updated!
8cc9cb0 to
51306a7
Compare
dhui
left a comment
There was a problem hiding this comment.
@leonklingele Thanks for addressing my feedback!
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
https://pkg.go.dev/errors#Join ↩