database/sql: document args, add a couple examples

Fixes #3460

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/7096046
This commit is contained in:
Brad Fitzpatrick 2013-01-11 14:46:49 -08:00
parent 5a9463bda7
commit 20130f141f
2 changed files with 46 additions and 0 deletions

View file

@ -373,6 +373,7 @@ func (db *DB) exec(query string, args []interface{}) (res Result, err error) {
}
// Query executes a query that returns rows, typically a SELECT.
// The args are for any placeholder parameters in the query.
func (db *DB) Query(query string, args ...interface{}) (*Rows, error) {
stmt, err := db.Prepare(query)
if err != nil {