fix 'string' type not to crash on 'nil' values
This commit is contained in:
parent
be180c8d95
commit
84d14dfd50
|
@ -10,6 +10,10 @@ func Match(name string) bool {
|
||||||
|
|
||||||
func Check(value interface{}) bool {
|
func Check(value interface{}) bool {
|
||||||
|
|
||||||
|
if value == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
kind := reflect.TypeOf(value).Kind()
|
kind := reflect.TypeOf(value).Kind()
|
||||||
|
|
||||||
return kind == reflect.String
|
return kind == reflect.String
|
||||||
|
|
Loading…
Reference in New Issue