golang编译xml怎么输出了xml
package main import ( "encoding/xml" "fmt" ) type Person struct { name string age int } func main() { person := Person{name:"Anyzm",age:18} if data,err := xml.MarshalIndent(person,"", " "); err != nil{ fmt.Println(err) return }else{ fmt.Println(data) } }
输出结果:
[60 80 101 114 115 111 110 62 60 47 80 101 114 115 111 110 62]