Often we need to read a file line by line.

Read file into memory and split into lines

https://codeeval.dev/gist/b84204634eb9a2246d33f9ff338f07d9

Iterate over lines in a file

It’s more efficient to only process one line at a time, as opposed to reading the whole file into memory.

We can do that using [bufio.Scanner](<https://golang.org/pkg/bufio/#Scanner>):

https://codeeval.dev/gist/ebd6a0bb552411ac257079e16105108d