I have the following code:
package main
import \"net\"
import \"fmt\"
import \"bufio\"
func main() {
conn, _ := net.Dial(\"tcp\", \"irc.freenode.net:66
Another common way to "wait for a goroutines end", is using WaitGroup:
http://golang.org/pkg/sync/#WaitGroup . You can use waitGroup.Add(1) for each started goroutine, then use waitGroup.Done() in each goroutine after it finishes. In the main function you can use waitGroup.Wait() and this will wait until waitGroup.Done() has been called for each added goroutine.