()
| 12 | ) |
| 13 | |
| 14 | func Example() { |
| 15 | if os.Getenv("MONGO_ADDR") == "" { |
| 16 | fmt.Println("set MONGO_ADDR to run this example") |
| 17 | return |
| 18 | } |
| 19 | c := core.New() |
| 20 | c.ProvideEssentials() |
| 21 | c.Provide(otmongo.Providers()) |
| 22 | c.Invoke(func(mongo *mongo.Client) { |
| 23 | err := mongo.Ping(context.Background(), readpref.Nearest()) |
| 24 | fmt.Println(err) |
| 25 | }) |
| 26 | // Output: |
| 27 | // <nil> |
| 28 | } |
nothing calls this directly
no test coverage detected