Sfoglia il codice sorgente

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 anni fa
parent
commit
ccd93d8b58
2 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  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
 }