Skip to content

Commit 2397470

Browse files
authored
Minor change to examples (#62)
Updated `res` to pointer in examples/queryrow/main.go Uncomment row print in examples/queryrows/main.go Signed-off-by: Tauseef Hussain <[email protected]>
1 parent 4da02dc commit 2397470

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/queryrow/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func main() {
4040
// defer cancel()
4141
ctx := context.Background()
4242
var res float64
43-
err1 := db.QueryRowContext(ctx, `select max(carat) from default.diamonds`).Scan(res)
43+
err1 := db.QueryRowContext(ctx, `select max(carat) from default.diamonds`).Scan(&res)
4444

4545
if err1 != nil {
4646
if err1 == sql.ErrNoRows {

examples/queryrows/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func main() {
8383
rows.Close()
8484
return
8585
}
86-
// fmt.Printf("%v, %v\n", res1, res2)
86+
fmt.Printf("%v, %v\n", res1, res2)
8787
}
8888

8989
}

0 commit comments

Comments
 (0)