implement atom
This commit is contained in:
@ -29,6 +29,10 @@ type Item struct {
|
||||
|
||||
func main() {
|
||||
fmt.Println("hello go")
|
||||
foo()
|
||||
if 1 == 1 {
|
||||
return
|
||||
}
|
||||
data, err := os.ReadFile("/home/balki/projects/tss/w.tmp/ounapuu.xml")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@ -93,11 +97,18 @@ func main() {
|
||||
func foo() {
|
||||
x := `
|
||||
<foo>
|
||||
<bar><blue>slkdfjdslk</blue></bar>
|
||||
<bar src="hello">
|
||||
<link href="http://foobar.com">Hello World</link>
|
||||
<blue>slkdfjdslk</blue>
|
||||
</bar>
|
||||
</foo>
|
||||
`
|
||||
s := struct {
|
||||
Bar struct {
|
||||
Link struct {
|
||||
Href string `xml:"href,attr"`
|
||||
} `xml:"link"`
|
||||
Attr string `xml:"src,attr"`
|
||||
Content string `xml:",innerxml"`
|
||||
} `xml:"bar"`
|
||||
}{}
|
||||
@ -106,5 +117,5 @@ func foo() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(s.Bar.Content)
|
||||
fmt.Println(s.Bar.Link.Href)
|
||||
}
|
||||
|
Reference in New Issue
Block a user