Multiple Return Values
Go functions can return more than one value.
Think of a vending machine that gives you a snack and also a receipt.
This is how Go usually sends back both a result and an error.
You will see this pattern everywhere.
Returning two values
List return types in parentheses.
Callers get each value in order, often with :=
Ignoring a return value
Use _ when you do not need one of the results.
That blank name means: throw this one away on purpose.
Result plus error
A common shape is (T, error).
Check the error before using the result.
nil means no error. Think of it as an empty sticky note.
Success path
When err is nil, trust the other values.
Print them or use them in the next step.
Why this matters
Returning errors keeps failure easy to see.
You do not hide problems inside thrown surprises.
Always check err != nil before trusting the other return values.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.