It wasn't easy but I was able to make it work: https://go.dev/play/p/FUxl_5SNUwA The only doubt I have is with the ReadWriter, for some mysterious reasons the following code didn't work: bufio.NewReadWriter( bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout), ) can someone explain to me why or give a cleaner solution then mine?
Bufio I believe needs delimiters
You also probably want to make the channel handling in a separate for loop inside a goroutine
Not always, there is bufio.NewReader and bufio.NewWriter that don't need it
Or a length right
Обсуждают сегодня