实例化数组中的类型

How can I instance an array with a given type?

I get the type this way:

type := reflect.ValueOf(obj)

But I don't know how to get an instance of an array with this type

Use reflect.MakeSlice for that:

type := reflect.ValueOf(obj)
reflectSlice := reflect.MakeSlice(type, sliceLength, sliceCapacity)