sourcegraph / conc

Better structured concurrency for go
https://about.sourcegraph.com/blog/building-conc-better-structured-concurrency-for-go
MIT License
9.05k stars 312 forks source link

Missing `Errors() []error` if used Go 1.20 #101

Closed prochac closed 1 year ago

prochac commented 1 year ago

Ok, my bad, now it's Unwrap() []error. IMO it should be noted somewhere, that the behavior of the library varies based on the version of used Go. It can cause backward incompatibility to some.

Old text: The errors.Join() feature in Go 1.20 is nice, but it's not possible to split the errors back to slice of errors.

With Uber implementation, that's under build tag for Go 1.19, it is possible

jdorfman commented 1 year ago

@camdencheek thoughts?

camdencheek commented 1 year ago

The goal of using the uber implementation for go 1.19 was to keep errors.Is and errors.As working as expected. I don't think it's possible to make the transition completely backwards compatible, but I'll add a note to the docs.

Thanks for the callout!