google / mangle

Apache License 2.0
1.07k stars 38 forks source link

Replace errors.Join with multierr.Combine to let the repo be used with go 1.18 #22

Closed sylph-eu closed 10 months ago

sylph-eu commented 10 months ago

This is the only place that's using errors.Join, while the rest of the code seems to rely on multierr.Combine.

The reason of this proposed change is that with errors.Join it's not possible to build/use the package with go 1.18. After the change, it starts to work.

go.mod still requires golang version 1.20, but it seems to work for my case anyway.

Please let me know what you think, thanks!

google-cla[bot] commented 10 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

burakemir commented 10 months ago

Hey, I will merge your patch since it was like this before. Thanks for the suggestion!

However, you cannot count on this repo remaining compatible with go 1.18... this code is used in places that keep up with the latest & greatest go version, and even testing that it works with go 1.20 is manual.

That said, when we have a proper major version release, I will check whether it works with older versions and backport fixes. If we find that can support older versions without effort, I might then consider picking an older version as baseline.

sylph-eu commented 10 months ago

Hi @burakemir , thanks a lot for looking at the PR! I totally understand that downgrading the whole repo to 1.18 is not possible at the moment.

This change just brings code-level compatibility with 1.18 and might be just enough to import google/mangle as is.