Golang go/scanner.Error.Error() function example
package go/scanner
Error implements the error interface.
Golang go/scanner.Error.Error() function usage example
if list, ok := err.(scanner.ErrorList); ok {
for _, e := range list {
fmt.Println(e.Error())
}
} else {
fmt.Println(err.Error())
}
Reference :
Advertisement
Something interesting
Tutorials
+23.1k Golang : simulate tail -f or read last line from log file example
+12.2k Golang : calculate elapsed run time
+7.7k Golang : Test if an input is an Armstrong number example
+22.4k Golang : Read directory content with filepath.Walk()
+6.1k Golang : Measure execution time for a function
+9.2k Golang : How to control fmt or log print format?
+19.9k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+11.3k Golang : Intercept and process UNIX signals example
+20.2k Golang : How to get struct tag and use field name to retrieve data?
+6k Golang : Compound interest over time example
+27.2k Golang : Find files by name - cross platform example
+5.1k Linux : How to set root password in Linux Mint