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

YouTube

Multiple Return Values in Go

Gary Clarke via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn how to implement and utilize Go's built-in multiple return value functionality in this 10-minute tutorial. Discover how to define functions that return more than one value by listing return types in parentheses, and master the technique of unpacking multiple return values using multiple variables on the caller side. Explore practical patterns like returning a primary result alongside a boolean success flag, and understand how this approach simplifies code by avoiding extra function calls or complex return structures. Practice with real examples including quotient and remainder calculations, and learn why the "ok" pattern is fundamental for error handling and validation throughout Go's standard library and real-world applications.

Syllabus

Multiple Return Values in Go

Taught by

Gary Clarke

Reviews

Start your review of Multiple Return Values 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.