Fix nil condition

This commit is contained in:
Jinzhu 2015-03-06 10:48:13 +08:00
parent 287ae22ca6
commit 42f934d60e
1 changed files with 3 additions and 3 deletions

View File

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