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{} {
2929 switch kind {
3030
3131 case reflect .Array , reflect .Slice , reflect .String :
32- index := toInt (i )
33- value := v .Index (int (index ))
32+ value := v .Index (toInt (i ))
3433 if value .IsValid () && value .CanInterface () {
3534 return value .Interface ()
3635 }
@@ -46,11 +45,9 @@ func fetch(from interface{}, i interface{}) interface{} {
4645 if value .IsValid () && value .CanInterface () {
4746 return value .Interface ()
4847 }
49-
50- case reflect .Func :
51- panic (fmt .Sprintf ("cannot fetch %v from %T" , i , from ))
5248 }
53- return nil
49+
50+ panic (fmt .Sprintf ("cannot fetch %v from %T" , i , from ))
5451}
5552
5653func slice (array , from , to interface {}) interface {} {
You can’t perform that action at this time.
0 commit comments