chore: update module definition with new domain
This commit is contained in:
24
xhtml/xhtml_test.go
Normal file
24
xhtml/xhtml_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package xhtml_test
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"log"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(t *testing.T) {
|
||||
type Bold struct {
|
||||
XMLName xml.Name `xml:"b"`
|
||||
Content string `xml:",chardata"`
|
||||
}
|
||||
type test struct {
|
||||
XMLName xml.Name `xml:"p"`
|
||||
Content string `xml:",chardata"`
|
||||
Bold []Bold `xml:"b"`
|
||||
}
|
||||
|
||||
var v test
|
||||
xml.Unmarshal([]byte(`<p>Hello, <b>world</b></p>`), &v)
|
||||
|
||||
log.Printf("%#v", v)
|
||||
}
|
||||
Reference in New Issue
Block a user