You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"encoding/xml"
"os"
)
type A struct {
Contents interface{} `xml:",innerxml"`
}
type B struct {
XMLName xml.Name `xml:"B"`
}
type C struct {
XMLName xml.Name `xml:"C"`
}
func main() {
var a A
a.Contents = []interface{}{B{}, C{}}
var enc = xml.NewEncoder(os.Stdout)
enc.Encode(&a)
}
If content fields are interface{}, we can (ironically) use type safe structs rather than raw strings for Content fields
The text was updated successfully, but these errors were encountered: