瀏覽代碼

s/Rebind/Bind/ and implement the test with an initial Bind() style, since we are not changing the Query() API and already have tests for it

Ben Hood 11 年之前
父節點
當前提交
ccd93d8b58
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 3 2
      cassandra_test.go
  2. 1 1
      session.go

+ 3 - 2
cassandra_test.go

@@ -568,7 +568,8 @@ func TestRebindQueryInfo(t *testing.T) {
 		t.Fatalf("insert into rebind_query failed, err '%v'", err)
 	}
 
-	q := session.Query("SELECT value FROM rebind_query WHERE ID = ?", 23)
+	q := session.Query("SELECT value FROM rebind_query WHERE ID = ?")
+	q.Bind(23)
 
 	iter := q.Iter()
 	var value string
@@ -579,7 +580,7 @@ func TestRebindQueryInfo(t *testing.T) {
 		t.Fatalf("expected %v but got %v", "quux", value)
 	}
 
-	q.Rebind(24)
+	q.Bind(24)
 	iter = q.Iter()
 
 	for iter.Scan(&value) {

+ 1 - 1
session.go

@@ -263,7 +263,7 @@ func (q *Query) RetryPolicy(r RetryPolicy) *Query {
 }
 
 // Rebind resets the query arguments of a previous bound query
-func (q *Query) Rebind(v ...interface{}) *Query {
+func (q *Query) Bind(v ...interface{}) *Query {
 	q.values = v
 	return q
 }