default type check 'string' does not use 'reflect' no more

This commit is contained in:
Adrien Marquès 2018-10-02 11:50:01 +02:00
parent 50de7a4297
commit e43623d108
1 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package main
import ( import (
"git.xdrm.io/go/aicra/driver" "git.xdrm.io/go/aicra/driver"
"reflect"
) )
func main() {} func main() {}
@ -20,8 +19,8 @@ func (sck StringChecker) Check(value interface{}) bool {
return false return false
} }
kind := reflect.TypeOf(value).Kind() _, ok := value.(string)
return kind == reflect.String return ok
} }