db.Exec and db.Query share the same multi-statement loop and trip the same "not enough args" check, but the error messages disagree on the second number.
Repro
_, errExec := db.Exec("SELECT ?; SELECT ?", "hello")
_, errQuery := db.Query("SELECT ?; SELECT ?", "hello")
fmt.Println(errExec)
fmt.Println(errQuery)
Output:
not enough args to execute query: want 1 got 1
not enough args to execute query: want 1 got 0
The two paths use the same check len(args)-start < na but format different numbers in the error.
db.Execanddb.Queryshare the same multi-statement loop and trip the same "not enough args" check, but the error messages disagree on the second number.Repro
Output:
The two paths use the same check
len(args)-start < nabut format different numbers in the error.