Go: Context With Timeout Helper
GoWrap a parent context with a deadline.
Go · 3 lines
copied 56 times
func withTimeout(parent context.Context, d time.Duration) (context.Context, context.CancelFunc) {
return context.WithTimeout(parent, d)
}
4
Fire
1
Learned something
0
Saved me time
1
Mind-blown
Sign in to react and star