Standard library / encoding/xml

encoding/xml.CharData

Represents text bytes within an XML element. Decoder-returned bytes may alias internal storage. Expected stdout: 'Go\n'.

Formal Syntax & Structure

go syntaxgo
type CharData []byte

Working Example

Example Snippetgo
package main
import (  "encoding/xml"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() { v := xml.CharData("Go"); fmt.Println(string(v)) }
Go Reference