| 416 | } |
| 417 | |
| 418 | func InterfaceToInterfaceSlice(in interface{}) ([]interface{}, bool) { |
| 419 | if in == nil { |
| 420 | return nil, true |
| 421 | } |
| 422 | |
| 423 | if inSlice, ok := in.([]interface{}); ok { |
| 424 | return inSlice, true |
| 425 | } |
| 426 | |
| 427 | if reflect.TypeOf(in).Kind() != reflect.Slice { |
| 428 | return nil, false |
| 429 | } |
| 430 | |
| 431 | inVal := reflect.ValueOf(in) |
| 432 | if inVal.IsNil() { |
| 433 | return nil, true |
| 434 | } |
| 435 | |
| 436 | out := make([]interface{}, inVal.Len()) |
| 437 | for i := 0; i < inVal.Len(); i++ { |
| 438 | out[i] = inVal.Index(i).Interface() |
| 439 | } |
| 440 | return out, true |
| 441 | } |
| 442 | |
| 443 | func InterfaceToIntSlice(in interface{}) ([]int, bool) { |
| 444 | if in == nil { |