Skip to content

Commit

Permalink
Add language tag to example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
titanous committed Jan 8, 2013
1 parent 7466953 commit 97ba33d
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@ Installation
Example
-------

db, err := sql.Open("gocql", "localhost:8000 keyspace=system")
```go
db, err := sql.Open("gocql", "localhost:8000 keyspace=system")
// ...
rows, err := db.Query("SELECT keyspace_name FROM schema_keyspaces")
// ...
for rows.Next() {
var keyspace string
err = rows.Scan(&keyspace)
// ...
fmt.Println(keyspace)
}
if err := rows.Err(); err != nil {
// ...
rows, err := db.Query("SELECT keyspace_name FROM schema_keyspaces")
// ...
for rows.Next() {
var keyspace string
err = rows.Scan(&keyspace)
// ...
fmt.Println(keyspace)
}
if err := rows.Err(); err != nil {
// ...
}
}
```

Please see `gocql_test.go` for some more advanced examples.

Expand Down

0 comments on commit 97ba33d

Please sign in to comment.