我有一个从一些XML文件中解析出来的对象。它有这样的结构类型typeReportstruct{Items[]Item`xml:......`AnotherItems[]AnotherItem`xml:......`}typeItemstruct{Namestring}typeAnotherItemstruct{Namestring}func(Item*Item)Foo()bool{//somecodehere}func(AnotherItem*AnotherItem)Foo()bool{//anothercodehere}对于每个项目我都必须这样做:funcmain(){//somef