Golang encoding/xml.SyntaxError type and Error() function example
package encoding/xml
A SyntaxError represents a syntax error in the XML input stream.
Golang encoding/xml.SyntaxError type usage example
...
switch tokentype := token.(type) {
case xml.SyntaxError:
return errors.New(tokentype.Error())
...
Reference :
Advertisement
Something interesting
Tutorials
+22.7k Golang : Round float to precision example
+41.2k Golang : How to count duplicate items in slice/array?
+8.2k Golang : Metaprogramming example of wrapping a function
+13.7k Golang : Image to ASCII art example
+10.2k Golang : Random Rune generator
+7.9k Setting $GOPATH environment variable for Unix/Linux and Windows
+4.7k Unix/Linux : How to pipe/save output of a command to file?
+6.5k Grep : How to grep for strings inside binary data
+16.1k Golang : How to check if input from os.Args is integer?
+8.2k Golang : Find relative luminance or color brightness
+16.6k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+15.2k Golang : Accurate and reliable decimal calculations