Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Basic Errors in Go

Gary Clarke via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn fundamental error handling in Go through this 12-minute tutorial that demonstrates how Go uses ordinary values instead of exceptions for error management. Discover how to create errors using the standard library's errors.New function, implement the common Go pattern of returning both results and errors from functions, and check for problems by comparing error values with nil. Master the conceptual approach where errors are normal values that keep control flow explicit and simple, with functions returning default values alongside errors when something goes wrong, and real results with nil when operations succeed. Explore how this error handling pattern appears throughout Go's standard library and forms the foundation for more advanced techniques like error wrapping and custom error types. Practice implementing early returns when errors occur to maintain clear, readable code that encourages simple control flow over exception-based approaches.

Syllabus

Basic Errors in Go

Taught by

Gary Clarke

Reviews

Start your review of Basic Errors in Go

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.