Error Handling: errors.New, Wrapping & Custom Types | Go Tutorial #19
15views
01comments
13:29
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Learn error handling in Go! This lesson covers everything from basic error creation to custom error types.
š What you'll learn:
- Creating errors with errors.New
- Returning errors from functions
- Error wrapping with fmt.Errorf and %w
- Checking errors with errors.Is
- Custom error types with errors.As
- Sentinel error patterns
Go uses explicit error returns instead of exceptions, making error handling predictable and clear.
ā±ļø Timestamps:
0:00 - Introduction
0:27 - Error Basics (errors.New, returning errors)
3:12 - Error Wrapping (fmt.Errorf, %w, Unwrap)
5:53 - Checking Errors (errors.Is, sentinel errors)
8:58 - Custom Error Types (errors.As)
12:08 - Recap
12:45 - Up Next: Defer, Panic, Recover
š» Code: https://github.com/GoCelesteAI/go_errors
š Subscribe for more Go tutorials!
#golang #go #programming #tutorial #errorhandling #coding #learntocode
Back to tutorialsOpen in YouTube
Duration
13:29
Published
February 3, 2026
Added to Codegiz
March 15, 2026