Golang encoding/xml.Token type example
package encoding/xml
A Token is an interface holding one of the token types: StartElement, EndElement, CharData, Comment, ProcInst, or Directive.
Golang encoding/xml.Token type usage example
var token xml.Token
switch tokentype := token.(type) {
case xml.SyntaxError:
return tokentype.Error()
case xml.CharData:
// do something
case xml.Comment:
// do something
case xml.Directive:
// do something
case xml.StartElement:
// do something
case xml.ProcInst:
// do something
case xml.EndElement:
// do something
}
Reference :
Advertisement
Something interesting
Tutorials
+15.3k Golang : Delete certain files in a directory
+15.6k Golang : How to convert(cast) IP address to string?
+9.4k Golang : Terminate-stay-resident or daemonize your program?
+13.1k Golang : Convert(cast) uintptr to string example
+14k Golang : Compress and decompress file with compress/flate example
+3.7k Golang : Switch Redis database redis.NewClient
+10.3k Golang : Convert file content to Hex
+8.5k Golang : How to check if input string is a word?
+10.6k Golang : Get local time and equivalent time in different time zone
+8.2k Golang : Qt splash screen with delay example
+30k Golang : How to declare kilobyte, megabyte, gigabyte, terabyte and so on?