File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ func ExampleRqlTerm_Get() {
1515 }
1616
1717 sess , err := r .Connect (map [string ]interface {}{
18- "address" : "localhost:28015" ,
18+ "address" : url ,
1919 })
2020
2121 // Setup table
@@ -54,7 +54,7 @@ func ExampleRqlTerm_GetAll_compound() {
5454 }
5555
5656 sess , err := r .Connect (map [string ]interface {}{
57- "address" : "localhost:28015" ,
57+ "address" : url ,
5858 })
5959
6060 // Setup table
Original file line number Diff line number Diff line change 88
99func ExampleRqlTerm_TableCreate () {
1010 sess , err := r .Connect (map [string ]interface {}{
11- "address" : "localhost:28015" ,
11+ "address" : url ,
1212 })
1313
1414 // Setup database
@@ -27,7 +27,7 @@ func ExampleRqlTerm_TableCreate() {
2727
2828func ExampleRqlTerm_IndexCreate () {
2929 sess , err := r .Connect (map [string ]interface {}{
30- "address" : "localhost:28015" ,
30+ "address" : url ,
3131 })
3232
3333 // Setup database
@@ -47,7 +47,7 @@ func ExampleRqlTerm_IndexCreate() {
4747
4848func ExampleRqlTerm_IndexCreate_compound () {
4949 sess , err := r .Connect (map [string ]interface {}{
50- "address" : "localhost:28015" ,
50+ "address" : url ,
5151 })
5252
5353 // Setup database
Original file line number Diff line number Diff line change @@ -4,13 +4,23 @@ import (
44 "fmt"
55 r "github.com/dancannon/gorethink"
66 "log"
7+ "os"
78)
89
910var session * r.Session
11+ var url string
12+
13+ func init () {
14+ // Needed for wercker. By default url is "localhost:28015"
15+ url = os .Getenv ("WERCKER_RETHINKDB_URL" )
16+ if url == "" {
17+ url = "localhost:28015"
18+ }
19+ }
1020
1121func Example () {
1222 session , err := r .Connect (map [string ]interface {}{
13- "address" : "localhost:28015" ,
23+ "address" : url ,
1424 })
1525 if err != nil {
1626 log .Fatalln (err .Error ())
You can’t perform that action at this time.
0 commit comments