소스 검색

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)
 		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
 }
 }