Computer scienceProgramming languagesGolangPackages and modulesStandard libraryContext package

Context cancellation and timeouts

Listen to the cancellation

Report a typo

Rearrange the code blocks so that they would correctly listen to processingCtx context cancellation and prints "the context was canceled" to the console.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                }
              
                select {
              
                fmt.Println("the context was canceled")
              
                case <-processingCtx.Done():
              
___

Create a free account to access the full topic