From caeb4040f2f1ba6376e98591d3637125bd582edd Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sun, 3 Jan 2016 20:29:46 +0800 Subject: [PATCH] Fix use []byte as condtions --- scope_private.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope_private.go b/scope_private.go index 4c5385d1..b0d7be52 100644 --- a/scope_private.go +++ b/scope_private.go @@ -49,7 +49,7 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri switch reflect.ValueOf(arg).Kind() { case reflect.Slice: // For where("id in (?)", []int64{1,2}) if bytes, ok := arg.([]byte); ok { - scope.AddToVars(bytes) + str = strings.Replace(str, "?", scope.AddToVars(bytes), 1) } else { values := reflect.ValueOf(arg) var tempMarks []string