我正在使用反射包来获取任意数组的类型,但是得到


   prog.go:17: cannot use sample_array1 (type []int) as type []interface {} in function argument [process exited with non-zero status]

如何从数组中获取类型?我知道如何从价值中获取它。


  func GetTypeArray(arr []interface{}) reflect.Type {

      return reflect.TypeOf(arr[0])

  }

http://play.golang.org/p/sNw8aL0a5f