Golang bufio.Text() function example

package bufio

Text returns the most recent token generated by a call to Scan as a newly allocated string holding its bytes.

Golang bufio.Text() function usage example

 scanner.Split(bufio.ScanLines)
 for scanner.Scan() {
 fmt.Println(scanner.Text()) // bufio.Text() here
 }

Reference :

http://golang.org/pkg/bufio/#Scanner.Text

Advertisement