Go Error Handling

Review error handling practices and idioms in Go.

1. What is the primary interface type for errors in Go?
2. Which of the following functions typically return an error as their last return value? (Select all that apply)
3. In Go, errors are treated as values rather than exceptions.
4. What function is commonly used to create a basic error message in Go? (full function name)
5. Which pattern is standard for checking if an error occurred in Go?
6. Which are considered good error handling practices in Go? (Select all that apply)
7. Panic should be used for recoverable errors in production code.
8. What verb in fmt.Errorf is used to wrap an error for later unwrapping with errors.Unwrap?
9. What does the Error() method of the error interface return?
10. Which are valid ways to define custom errors in Go? (Select all that apply)
Answered 0 of 0 — 0 correct