cockroachdb / errors

Go error library with error portability over the network
Apache License 2.0
2.04k stars 66 forks source link

IsAny() multi error support #140

Closed nikitacrit closed 2 months ago

nikitacrit commented 2 months ago

Hello! At the moment the following code will produce the result "no". I suggest a fix based on the code found in the original method Is().

func main() {
    err := errors.Join(io.EOF, errors.New("gopher"))

    if errors.IsAny(err, io.EOF, net.ErrClosed) {
        fmt.Print("yes")
    } else {
        fmt.Print("no")
    }
}

This change is Reviewable

cockroach-teamcity commented 2 months ago

CLA assistant check
All committers have signed the CLA.

nikitacrit commented 2 months ago

@dhartunian Hi David. I see your latest activity in this repository and would like to ask if contributions are welcome and if someone can review the changes?

dhartunian commented 2 months ago

@nikitacrit thanks for the ping, I'll take a look when I get a chance, probably over the next few days.