Skip to content

Commit

Permalink
Fix examples in coroutine-basics.md (Kotlin#2711)
Browse files Browse the repository at this point in the history
Co-authored-by: Johnny Lim <izeye@naver.com>
  • Loading branch information
elizarov and izeye committed May 19, 2021
1 parent c03ca62 commit 00e6cbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions docs/topics/coroutines-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ suspend fun doWorld() = coroutineScope { // this: CoroutineScope

This code also prints:

<!--- TEST
```text
Hello
World!
-->
```

<!--- TEST -->

## Scope builder and concurrency

Expand All @@ -166,7 +168,7 @@ Let's launch two concurrent coroutines inside a `doWorld` suspending function:
import kotlinx.coroutines.*

//sampleStart
// Sequentially executes doWorld followed by "Hello"
// Sequentially executes doWorld followed by "Done"
fun main() = runBlocking {
doWorld()
println("Done")
Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/guide/example-basic-04.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package kotlinx.coroutines.guide.exampleBasic04

import kotlinx.coroutines.*

// Sequentially executes doWorld followed by "Hello"
// Sequentially executes doWorld followed by "Done"
fun main() = runBlocking {
doWorld()
println("Done")
Expand Down

0 comments on commit 00e6cbf

Please sign in to comment.