Intermediate
Go (Golang)
Q46 / 100
What is an error wrapping in Go 1.13+?
Correct! Well done.
Incorrect.
The correct answer is B) Adding context to an error with %w in fmt.Errorf, preserving the original error for errors.Is/As inspection
B
Correct Answer
Adding context to an error with %w in fmt.Errorf, preserving the original error for errors.Is/As inspection
Explanation
fmt.Errorf("parsing: %w", err) wraps err. errors.Is(wrappedErr, io.EOF) traverses the chain.
Progress
46/100