mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
database/sql: rename NamedParam to NamedArg and Param to Named
Be consistent with the argument names already provided. Also parameter is the variable, argument is the value. Fixes #18099 Change-Id: Idb3f4e9ffc214036c721ddb4f614ec6c95bb7778 Reviewed-on: https://go-review.googlesource.com/33660 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
feacaca7a0
commit
2b1abf7594
3 changed files with 23 additions and 12 deletions
|
|
@ -468,15 +468,15 @@ func TestMultiResultSetQuery(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestQueryNamedParam(t *testing.T) {
|
||||
func TestQueryNamedArg(t *testing.T) {
|
||||
db := newTestDB(t, "people")
|
||||
defer closeDB(t, db)
|
||||
prepares0 := numPrepares(t, db)
|
||||
rows, err := db.Query(
|
||||
// Ensure the name and age parameters only match on placeholder name, not position.
|
||||
"SELECT|people|age,name|name=?name,age=?age",
|
||||
Param("?age", 2),
|
||||
Param("?name", "Bob"),
|
||||
Named("?age", 2),
|
||||
Named("?name", "Bob"),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("Query: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue