From 42f934d60e0ff98cc292e94e484be7ea50d6c29c Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Fri, 6 Mar 2015 10:48:13 +0800 Subject: [PATCH] Fix nil condition --- scope_private.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scope_private.go b/scope_private.go index 5b69c0da..308b4cb3 100644 --- a/scope_private.go +++ b/scope_private.go @@ -48,7 +48,7 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri args := clause["args"].([]interface{}) for _, arg := range args { - switch reflect.TypeOf(arg).Kind() { + switch reflect.ValueOf(arg).Kind() { case reflect.Slice: // For where("id in (?)", []int64{1,2}) values := reflect.ValueOf(arg) var tempMarks []string @@ -110,7 +110,7 @@ func (scope *Scope) buildNotCondition(clause map[string]interface{}) (str string args := clause["args"].([]interface{}) for _, arg := range args { - switch reflect.TypeOf(arg).Kind() { + switch reflect.ValueOf(arg).Kind() { case reflect.Slice: // For where("id in (?)", []int64{1,2}) values := reflect.ValueOf(arg) var tempMarks []string @@ -138,7 +138,7 @@ func (scope *Scope) buildSelectQuery(clause map[string]interface{}) (str string) args := clause["args"].([]interface{}) for _, arg := range args { - switch reflect.TypeOf(arg).Kind() { + switch reflect.ValueOf(arg).Kind() { case reflect.Slice: values := reflect.ValueOf(arg) var tempMarks []string