Jelajahi Sumber

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 tahun lalu
induk
melakukan
ccd93d8b58
2 mengubah file dengan 4 tambahan dan 3 penghapusan
  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)
 		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()
 	iter := q.Iter()
 	var value string
 	var value string
@@ -579,7 +580,7 @@ func TestRebindQueryInfo(t *testing.T) {
 		t.Fatalf("expected %v but got %v", "quux", value)
 		t.Fatalf("expected %v but got %v", "quux", value)
 	}
 	}
 
 
-	q.Rebind(24)
+	q.Bind(24)
 	iter = q.Iter()
 	iter = q.Iter()
 
 
 	for iter.Scan(&value) {
 	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
 // 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
 	q.values = v
 	return q
 	return q
 }
 }