File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,7 @@ func fetch(from interface{}, i interface{}) interface{} {
29
29
switch kind {
30
30
31
31
case reflect .Array , reflect .Slice , reflect .String :
32
- index := toInt (i )
33
- value := v .Index (int (index ))
32
+ value := v .Index (toInt (i ))
34
33
if value .IsValid () && value .CanInterface () {
35
34
return value .Interface ()
36
35
}
@@ -46,11 +45,9 @@ func fetch(from interface{}, i interface{}) interface{} {
46
45
if value .IsValid () && value .CanInterface () {
47
46
return value .Interface ()
48
47
}
49
-
50
- case reflect .Func :
51
- panic (fmt .Sprintf ("cannot fetch %v from %T" , i , from ))
52
48
}
53
- return nil
49
+
50
+ panic (fmt .Sprintf ("cannot fetch %v from %T" , i , from ))
54
51
}
55
52
56
53
func slice (array , from , to interface {}) interface {} {
You can’t perform that action at this time.
0 commit comments