udpate deps

This commit is contained in:
Cory Bennett
2018-07-28 16:29:51 -07:00
parent 07ba74b34a
commit d16bcc2f51
237 changed files with 32346 additions and 10808 deletions
+9 -2
View File
@@ -158,7 +158,11 @@ func indirectType(reflectType reflect.Type) reflect.Type {
func set(to, from reflect.Value) bool {
if from.IsValid() {
if to.Kind() == reflect.Ptr {
if to.IsNil() {
//set `to` to nil if from is nil
if from.Kind() == reflect.Ptr && from.IsNil() {
to.Set(reflect.Zero(to.Type()))
return true
} else if to.IsNil() {
to.Set(reflect.New(to.Type().Elem()))
}
to = to.Elem()
@@ -167,7 +171,10 @@ func set(to, from reflect.Value) bool {
if from.Type().ConvertibleTo(to.Type()) {
to.Set(from.Convert(to.Type()))
} else if scanner, ok := to.Addr().Interface().(sql.Scanner); ok {
scanner.Scan(from.Interface())
err := scanner.Scan(from.Interface())
if err != nil {
return false
}
} else if from.Kind() == reflect.Ptr {
return set(to, from.Elem())
} else {