golang之void*类型可变数组例子
package main import ( "fmt" ) type TestStruct struct { aa string name string } type Object interface{} func main() { array := []Object{} a := TestStruct{} a.aa = "aaaa" a.name = "name" array = append(array, 1) array = append(array, a) for index, value := range array { fmt.Printf("arr[%d]=%d \n", index, value) } }