Skip to content

Commit 96f8972

Browse files
committed
DOCSP-39153: Reduce horizontal scroll in Quick Start (#361)
* 1.14 Code Fixes (#353) (cherry picked from commit f1993ed) * remove context * DOCSP-39153: Reduce horizontal scroll in Quick Start * shorten (cherry picked from commit 43b13a5) (cherry picked from commit f1dfc7c)
1 parent b5edcb6 commit 96f8972

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

source/includes/quick-start/main.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ func main() {
2020

2121
uri := os.Getenv("MONGODB_URI")
2222
if uri == "" {
23-
log.Fatal("You must set your 'MONGODB_URI' environment variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/#environment-variable")
23+
log.Fatal("Set your 'MONGODB_URI' environment variable. " +
24+
"See: " +
25+
"www.mongodb.com/docs/drivers/go/current/usage-examples/#environment-variable")
2426
}
25-
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
27+
client, err := mongo.Connect(context.TODO(), options.Client().
28+
ApplyURI(uri))
2629
if err != nil {
2730
panic(err)
2831
}
@@ -37,7 +40,8 @@ func main() {
3740
title := "Back to the Future"
3841

3942
var result bson.M
40-
err = coll.FindOne(context.TODO(), bson.D{{"title", title}}).Decode(&result)
43+
err = coll.FindOne(context.TODO(), bson.D{{"title", title}}).
44+
Decode(&result)
4145
if err == mongo.ErrNoDocuments {
4246
fmt.Printf("No document was found with the title %s\n", title)
4347
return

0 commit comments

Comments
 (0)