Reputation: 12877
What's the difference between scanner.Scanner from package text/scanner, and a bufio.Scanner?
Upvotes: 1
Views: 962
Reputation: 99351
text/scanner
is more optimized for reading source code, mostly Go source:
By default, a Scanner skips white space and Go comments and recognizes all literals as defined by the Go language specification. It may be customized to recognize only a subset of those literals and to recognize different white space characters.
Upvotes: 4
Reputation: 48330
The documentation seems to explain pretty clearly.
text/scanner
A Scanner implements reading of Unicode characters and tokens from an io.Reader
bufio
Scanner provides a convenient interface for reading data such as a file of newline-delimited lines of text.
Upvotes: -4