I'd like to read longer text using Golang stdin

  • If you need to process the input line by line, using bufio.Reader is more suitable.
  • If you need to read the entire input as a single string and memory usage isn’t a concern, io.ReadAll is simpler.