Goroutines
A goroutine is a helper that works at the same time as other code.
Starting a helper is easy and light. You can start many of them.
Go runs these helpers for you.
Big programs often use lots of helpers at once.
Starting a goroutine
Put go in front of a function call.
Your code does not wait.
The helper keeps working while you do the next step.
Anonymous helpers
You can also start a tiny helper with no name.
That is handy for a small job you only need once.
Loop variables
Be careful with loop variables.
Pass them as arguments so each helper gets its own copy.
Otherwise helpers may all see the last value.
Waiting without Sleep
Sleep is only a quick demo. Do not use it in real apps.
Real programs wait with channels or a WaitGroup.
Then main does not finish too early.
Why helpers matter
One helper can fetch data while another prints a page.
Your program keeps moving instead of waiting in a single line.
Next: channels, a clear way for helpers to send data safely.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.