In this lecture, we’ll cover one of Go’s key idioms: multiple return values and the
(
value
,
error
) contract. Using examples, we’ll see how to receive results via
a
,
b
:=
f
(), when to use the “blank identifier”
_, why on error people usually return a zero value, and how to write linear code with an early
return based on
err. At the end, we’ll go over common mistakes and how to avoid them.