title: How to launch a Kotlin coroutine in a `suspend fun` that uses the current parent Scope?
body: <p>How can I launch a coroutine from a suspend function and have it use the current Scope? (so that the Scope doesn't end until the launched coroutine also ends)</p>
  
  <p>I'd like to write something like the following –</p>
  
  <pre><code>import kotlinx.coroutines.*
  
  fun main() = runBlocking { // this: CoroutineScope
      go()
  }
  
  suspend fun go() {
      launch {
          println("go!")
      }
  }
  </code></pre>
  
  <p>But this has a syntax error: "Unresolved Reference: launch". It seems <code>launch</code> must be run in one of the following ways –</p>
  
  <pre><code>GlobalScope.launch {
      println("Go!")
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>runBlocking {
      launch {
          println("Go!")
      }
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>withContext(Dispatchers.Default) {
      launch {
          println("Go!")
      }
  }
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>coroutineScope {
      launch {
          println("Go!")
      }
  }
  </code></pre>
  
  <p>None of these alternatives does what I need. Either the code "blocks" instead of "spawning", or it spawns but the parent scope won't wait for its completion before the parent scope itself ends.</p>
  
  <p>I need it to "spawn" (launch) in the current parent coroutine scope, and that parent scope should wait for the spawned coroutine to finish before it ends itself.</p>
  
  <p>I expected that a simple <code>launch</code> inside a <code>suspend fun</code> would be valid and use its parent scope.</p>
  
  <p>I'm using <code>Kotlin 1.3</code> and <code>cotlinx-coroutines-core:1.0.1</code>.</p>