Goroutines behavior
<p>For example i have this code:</p>

<pre><code>func main() {
    go myRoutine(1, channel)
    go myRoutine(2, channel)
    go myRoutine(3, channel)
    go myRoutine(4, channel)

    for i := 0; i &lt; 4; i++ {
        fmt.Println("Returned routine:", &lt;-channel)
    }
}

func myRoutine(chnum int, c chan int) {
    //doing some stuff here
    c &lt;- chnum
    //and doing some stuff here
}
</code></pre>

<p>I want myRoutine to exit just after writing to channel.
Google tells that i should have shutdown channel and signal here if i want exit my goroutine.
I wanted to know isn't it enough just add return after с &lt;- chnum?</p>

<p>And second question about goroutines:
When i start my app it creates 4 processes (one per cpu core) and my routines add two more. Should i do something to kill this two processes after finishing goroutines or Go does it by himself?                                                  </p>