Intermediate Go (Golang)
Q43 / 100

What is the errors.Is() function?

Correct! Well done.

Incorrect.

The correct answer is B) Checks if an error matches a target error by unwrapping the error chain

B

Correct Answer

Checks if an error matches a target error by unwrapping the error chain

Explanation

errors.Is(err, ErrNotFound) unwraps the error chain to check if any error matches ErrNotFound. Use errors.As() to extract a specific error type.

Progress
43/100