Is it okay to use os.stdin as a Reader in a Goroutine? Basically what I would like to accomplish is to enable the user to enter a message without blocking the main thread.
Example:
go func() {
for {
consolereader := bufio.NewReader(os.Stdin)
input, err := consolereader.ReadString('
') // this will prompt the user for input
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(input)
}
}()