diff --git a/mongo/_example/main.go b/mongo/_example/main.go index 88420f8557180d90ea5b6bc3b1eed0d94ec6a777..e5603dbd344bff7b238212c6cf0531c7f184b08d 100644 --- a/mongo/_example/main.go +++ b/mongo/_example/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "log" + "os" "time" "upper.io/db" // Imports the main db package. @@ -23,6 +24,10 @@ type Birthday struct { func main() { + if os.Getenv("TEST_HOST") != "" { + settings.Host = os.Getenv("TEST_HOST") + } + // Attemping to establish a connection to the database. sess, err := db.Open("mongo", settings)