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:
Daniel Theophanes 2016-11-29 09:57:17 -08:00 committed by Brad Fitzpatrick
parent feacaca7a0
commit 2b1abf7594
3 changed files with 23 additions and 12 deletions

View file

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