fix 'string' type not to crash on 'nil' values

This commit is contained in:
Adrien Marquès 2018-05-31 09:23:30 +02:00
parent be180c8d95
commit 84d14dfd50
1 changed files with 4 additions and 0 deletions

View File

@ -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