Can't use range on slice made with reflect then passed json.Unmarshal
问题 I am getting the following errors from the code below: invalid indirect of typedSlice (type interface {}) cannot range over typedSlice (type interface {}) This is confusing to me because reflect.TypeOf(copy) matches the type of t . func Unmarshal(t reflect.Type) []interface{} { ret := []interface{}{} s := `[{"Name":"The quick..."}]` slice := reflect.Zero(reflect.SliceOf(t)) o := reflect.New(slice.Type()) o.Elem().Set(slice) typedSlice := o.Interface() json.Unmarshal([]byte(s), typedSlice) fmt