Tweak example in readme
This commit is contained in:
@@ -22,10 +22,13 @@ standard Scan interface. These directly return interface{}, []interface{},
|
|||||||
map[string]interface{}, and []map[string]interface{} respectively. SelectFunc
|
map[string]interface{}, and []map[string]interface{} respectively. SelectFunc
|
||||||
offers custom row by row processing.
|
offers custom row by row processing.
|
||||||
|
|
||||||
if widgets, err := conn.SelectRows("select * from widgets where type=$1", type); err != nil {
|
```go
|
||||||
// do something with widgets
|
if widgets, err := conn.SelectRows("select name, weight from widgets where type=$1", type); err != nil {
|
||||||
|
for w := range widgets {
|
||||||
|
fmt.Printf("%v has a weight of %v.", widgets["name"], widgets["weight"])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Prepared Statements
|
### Prepared Statements
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user