mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
14 lines
306 B
Go
14 lines
306 B
Go
|
package variables
|
||
|
|
||
|
import "reflect"
|
||
|
|
||
|
// IsMap checks if some variable is a map
|
||
|
func IsMap(sth interface{}) bool {
|
||
|
return reflect.ValueOf(sth).Kind() == reflect.Map
|
||
|
}
|
||
|
|
||
|
// IsSlice checks if some variable is a slice
|
||
|
func IsSlice(sth interface{}) bool {
|
||
|
return reflect.ValueOf(sth).Kind() == reflect.Slice
|
||
|
}
|