context પેકેજ કેન્સલેશન સિગ્નલ્સ, ડેડલાઈનો, અને રિક્વેસ્ટ-સ્કોપ્ડ વેલ્યુઝ API બાઉન્ડરીઝ અને ગોરૌટીનો વચ્ચે વહન કરે છે. તે ઓપરેશનોના જીવનકાળને નિયંત્રણ કરવાની માનક મર્યાદા છે — ખાસ કરીને કામને કેન્સલ કરવા અને ફંક્શન કોલ્સની સાંકળ દ્વારા ટાઈમઆઉટ પ્રસારિત કરવા માટે.
જે મુખ્ય સમસ્યા તેઓ હલ કરે છે
A request starts work across many goroutines/functions (DB query, API call, etc.).
If the client disconnects or a timeout hits, you want to CANCEL all that work
so goroutines don't keep running uselessly (wasting resources / leaking).
→ context propagates the "stop now" signal down the entire call chain.
