go-by-test/context
vinchent c5582275e7 context: realistic usage of context.
Use a go routine for the work logic. Here sleep and append to string.
Inside the go routine, select for ctx.Done(). If happens, just stop and
return.

In the outside function, select for ctx.Done() too. If it happens, that
means the work logic has not finished before canceled.
2024-09-21 20:35:43 +02:00
..
context_test.go context: realistic usage of context. 2024-09-21 20:35:43 +02:00
context.go context: realistic usage of context. 2024-09-21 20:35:43 +02:00