readline
Compare and contrast the functions below for the use case of traversing each line of a text file.
fmt.Fscanf()
bufio.Reader.ReadLine()
bufio.ReadString('\n')
bufio.Scanner.Scan()
Answer
bufio.Scanner.Scan(): Best suited
fmt.Fscanf(): Only applicable to formated lines
bufio.Reader.ReadLine(): Very low level. May require more invocations when buffer limit is exceeded.
bufio.ReadString('\n'): Cannot handle EOF