func SafeSliceCutInterface(sli interface{}, start, end int) interface{} {
if start < 0 || end <= 0 || start > end {
return nil
}
// check slice type
sliV := reflect.ValueOf(sli)
if sliV.Kind() != reflect.Slice {
return nil
}
sliLen := sliV.Len()
if sliLen == 0 {
return nil
}
if start > sliLen {
return nil
}
if end > sliLen {
return sliV.Slice(start, sliLen).Interface() //note:reflect.Value convert to interface
}
return sliV.Slice(start, end).Interface()
}