Go theorytheory 0/50 · 0%
Error handling · easy

14. Errors

Errors are values.

`error` is an interface with an Error() string method. Functions return errors that callers check immediately. errors.New and fmt.Errorf with %w create and wrap errors; errors.Is and errors.As inspect wrapped chains.

Check your understanding

  1. 1. Which verb wraps an error?

  2. 2. Which function matches a sentinel error?