@@ -293,7 +293,7 @@ func ExampleConnect_aWS() {
293
293
context .TODO (),
294
294
options .Client ().SetAuth (awsCredential ))
295
295
if err != nil {
296
- panic (err )
296
+ log . Fatal (err )
297
297
}
298
298
_ = awsIAMClient
299
299
@@ -315,7 +315,7 @@ func ExampleConnect_aWS() {
315
315
context .TODO (),
316
316
options .Client ().SetAuth (assumeRoleCredential ))
317
317
if err != nil {
318
- panic (err )
318
+ log . Fatal (err )
319
319
}
320
320
_ = assumeRoleClient
321
321
@@ -337,7 +337,7 @@ func ExampleConnect_aWS() {
337
337
context .TODO (),
338
338
options .Client ().SetAuth (envVariablesCredential ))
339
339
if err != nil {
340
- panic (err )
340
+ log . Fatal (err )
341
341
}
342
342
_ = envVariablesClient
343
343
@@ -355,7 +355,7 @@ func ExampleConnect_aWS() {
355
355
context .TODO (),
356
356
options .Client ().SetAuth (ecCredential ))
357
357
if err != nil {
358
- panic (err )
358
+ log . Fatal (err )
359
359
}
360
360
_ = ecClient
361
361
}
@@ -386,7 +386,7 @@ func ExampleConnect_stableAPI() {
386
386
context .TODO (),
387
387
options .Client ().SetServerAPIOptions (serverAPI ))
388
388
if err != nil {
389
- panic (err )
389
+ log . Fatal (err )
390
390
}
391
391
_ = serverAPIClient
392
392
@@ -401,7 +401,7 @@ func ExampleConnect_stableAPI() {
401
401
context .TODO (),
402
402
options .Client ().SetServerAPIOptions (serverAPIStrict ))
403
403
if err != nil {
404
- panic (err )
404
+ log . Fatal (err )
405
405
}
406
406
407
407
coll := serverAPIStrictClient .Database ("db" ).Collection ("coll" )
@@ -420,7 +420,7 @@ func ExampleConnect_stableAPI() {
420
420
context .TODO (),
421
421
options .Client ().SetServerAPIOptions (serverAPIDeprecation ))
422
422
if err != nil {
423
- panic (err )
423
+ log . Fatal (err )
424
424
}
425
425
_ = serverAPIDeprecationClient
426
426
}
@@ -445,11 +445,11 @@ func ExampleConnect_bSONOptions() {
445
445
446
446
client , err := mongo .Connect (context .TODO (), clientOpts )
447
447
if err != nil {
448
- panic (err )
448
+ log . Fatal (err )
449
449
}
450
450
defer func () {
451
451
if err := client .Disconnect (context .TODO ()); err != nil {
452
- panic (err )
452
+ log . Fatal (err )
453
453
}
454
454
}()
455
455
@@ -466,7 +466,7 @@ func ExampleConnect_bSONOptions() {
466
466
// resulting BSON document to have a structure like {"a": {}, "b": []}
467
467
_ , err = coll .InsertOne (context .TODO (), myDocument {})
468
468
if err != nil {
469
- panic (err )
469
+ log . Fatal (err )
470
470
}
471
471
}
472
472
@@ -504,7 +504,7 @@ func ExampleConnect_oIDC() {
504
504
)
505
505
c , err := mongo .Connect (context .TODO (), opts )
506
506
if err != nil {
507
- panic (err )
507
+ log . Fatal (err )
508
508
}
509
509
defer c .Disconnect (context .TODO ())
510
510
c .Database ("test" ).Collection ("test" ).InsertOne (context .TODO (), bson.D {})
@@ -530,7 +530,7 @@ func ExampleConnect_oIDC() {
530
530
)
531
531
c , err := mongo .Connect (context .TODO (), opts )
532
532
if err != nil {
533
- panic (err )
533
+ log . Fatal (err )
534
534
}
535
535
defer c .Disconnect (context .TODO ())
536
536
c .Database ("test" ).Collection ("test" ).InsertOne (context .TODO (), bson.D {})
@@ -568,7 +568,7 @@ func ExampleConnect_oIDC() {
568
568
)
569
569
c , err := mongo .Connect (context .TODO (), opts )
570
570
if err != nil {
571
- panic (err )
571
+ log . Fatal (err )
572
572
}
573
573
defer c .Disconnect (context .TODO ())
574
574
c .Database ("test" ).Collection ("test" ).InsertOne (context .TODO (), bson.D {})
@@ -608,7 +608,7 @@ func ExampleConnect_oIDC() {
608
608
)
609
609
c , err := mongo .Connect (context .TODO (), opts )
610
610
if err != nil {
611
- panic (err )
611
+ log . Fatal (err )
612
612
}
613
613
defer c .Disconnect (context .TODO ())
614
614
c .Database ("test" ).Collection ("test" ).InsertOne (context .TODO (), bson.D {})
@@ -649,7 +649,7 @@ func ExampleConnect_oIDC() {
649
649
)
650
650
c , err := mongo .Connect (context .TODO (), opts )
651
651
if err != nil {
652
- panic (err )
652
+ log . Fatal (err )
653
653
}
654
654
defer c .Disconnect (context .TODO ())
655
655
c .Database ("test" ).Collection ("test" ).InsertOne (context .TODO (), bson.D {})
0 commit comments