I am a novice, and that is one of the reasons why I started this project (to learn).
bytes, _ := ioutil.ReadAll(os.Stdin)
lines := strings.Split(string(bytes), "\n")
Tip: use bufio.Scanner. scanner := bufio.NewScanner(reader)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
// Do stuff
}
And you can iterate over the lines 'lazily'. If you don't want to consume \r's, make your own ScanLines :).And you may want to mmap the file, rather than open it. Whether that is a speeds up things depends on OS, OS version, file size, file system, available memory, phase of the moon, etc.