3
0
corteza/pkg/report/util.go
2021-08-16 09:16:07 +02:00

17 lines
270 B
Go

package report
import (
"reflect"
)
func isNil(i interface{}) bool {
if i == nil {
return true
}
switch reflect.TypeOf(i).Kind() {
case reflect.Ptr, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice:
return reflect.ValueOf(i).IsNil()
}
return false
}