It's a little unclear how os.stdin actually works. Why, if you just run the program, is data from stdin constantly being listened to? For example: func main() { sc := bufio.NewScanner(os.Stdin) for sc.Scan() { txt := sc.Text() fmt.Printf("echo: %s\n", txt) } } But if you send it to stdin ahead of time, the loop will run once and the program will exit(echo smth | go run main.go)
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/268474da-8748-482a-b961-f50fcdbcd68dn%40googlegroups.com.