Skip to content

Instantly share code, notes, and snippets.

@euoia
Created April 1, 2015 10:58
Show Gist options
  • Select an option

  • Save euoia/52f0426b2dfa32447b66 to your computer and use it in GitHub Desktop.

Select an option

Save euoia/52f0426b2dfa32447b66 to your computer and use it in GitHub Desktop.
fatal error: all goroutines are asleep - deadlock!
package main
import (
"bufio"
"fmt"
"io"
)
func main() {
r, w := io.Pipe()
reader := bufio.NewReader(r)
writer := bufio.NewWriter(w)
fmt.Fprintln(writer, "hello world")
reader.ReadLine()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment