errors icon indicating copy to clipboard operation
errors copied to clipboard

IsAny() multi error support

Open nikitacrit opened this issue 1 year ago • 3 comments

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

nikitacrit avatar May 06 '24 19:05 nikitacrit

CLA assistant check
All committers have signed the CLA.

cockroach-teamcity avatar May 06 '24 19:05 cockroach-teamcity

@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?

nikitacrit avatar May 07 '24 17:05 nikitacrit

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

dhartunian avatar May 07 '24 18:05 dhartunian