Golang bufio.Err() function example
package bufio
Err returns the first non-EOF error that was encountered by the Scanner.
Golang bufio.Err() function usage example
reader := bufio.NewReader(file)
scanner := bufio.NewScanner(reader)
scanner.Split(bufio.ScanBytes)
for scanner.Scan() {
fmt.Println(scanner.Bytes())
err := scanner.Err()
if err != nil {
panic(err)
}
}
Advertisement
Something interesting
Tutorials
+5.2k Golang : Calculate half life decay example
+13.2k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
+6.8k Golang : Muxing with Martini example
+6.4k Golang : Break string into a slice of characters example
+19.9k Golang : Count JSON objects and convert to slice/array
+7.4k Golang : Accessing dataframe-go element by row, column and name example
+19.1k Mac OSX : Homebrew and Golang
+5.9k Golang : Extract unicode string from another unicode string example
+23.5k Golang : Read a file into an array or slice example
+5.7k Golang : Error handling methods
+10.5k Golang : Select region of interest with mouse click and crop from image
+7.5k Golang : Dealing with struct's private part