mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-15 23:44:26 +00:00
Fixed and refactored reflection.Len
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package common
|
||||
|
||||
import "reflect"
|
||||
|
||||
func Len(v any) int {
|
||||
val := reflect.ValueOf(v)
|
||||
switch val.Kind() {
|
||||
case reflect.Slice, reflect.Array, reflect.Map, reflect.String, reflect.Chan:
|
||||
return val.Len()
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user